# More problems

**URL:** <https://discourse.libsdl.org/t/more-problems/4964>\
**Category:** SDL Development\
**Created:** [August 25, 2001, 1:25am UTC](https://discourse.libsdl.org/t/more-problems/4964 "2001-08-25T01:25:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Weisgerber](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@David\_Weisgerber](https://discourse.libsdl.org/u/David_Weisgerber)\
**Post date:** [August 25, 2001, 1:25am UTC](https://discourse.libsdl.org/t/more-problems/4964/1 "2001-08-25T01:25:01Z")

</div>

Because I couldn’t compile, I installed the rpms, now I get this:

/usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
reference to `pthread_create' /usr/lib/gcc-lib/i586-mandrake-linux/2.96/../../../libSDL.so: undefined reference to`pthread\_cancel’  
/usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
reference to `sem_destroy' /usr/lib/gcc-lib/i586-mandrake-linux/2.96/../../../libSDL.so: undefined reference to`sem\_wait’  
/usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
reference to `sem_post' /usr/lib/gcc-lib/i586-mandrake-linux/2.96/../../../libSDL.so: undefined reference to`pthread\_mutexattr\_setkind\_np’  
/usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
reference to `sem_init' /usr/lib/gcc-lib/i586-mandrake-linux/2.96/../../../libSDL.so: undefined reference to`pthread\_sigmask’  
/usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
reference to `sem_trywait' /usr/lib/gcc-lib/i586-mandrake-linux/2.96/../../../libSDL.so: undefined reference to`pthread\_mutexattr\_init’  
/usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
reference to `sem_getvalue' /usr/lib/gcc-lib/i586-mandrake-linux/2.96/../../../libSDL.so: undefined reference to`pthread\_join’  
/usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
reference to `pthread\_cond\_timedwait’  
collect2: ld returned 1 exit status–  
Wie viele Microsoft Angestellte braucht man um eine Gl?hbirne  
auszuwechseln?  
Keinen, sie rufen bei INTEL an, weil es ein Hardwareproblem ist.

---

<div class="post-metadata">

**Author:** ![Sam\_Hart](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/d26b3c/32.png) [@Sam\_Hart](https://discourse.libsdl.org/u/Sam_Hart)\
**Post date:** [August 27, 2001, 2:47pm UTC](https://discourse.libsdl.org/t/more-problems/4964/2 "2001-08-27T14:47:01Z")

</div>

Not sure if anyone ever responded to this, but it looks like you are missing  
the pthreads library. I’m actually shocked, I didn’t think there were any  
RPM-based distros anymore that shiped without libpthreads ;-)On Saturday 25 August 2001 7:25am, David Weisgerber wrote:

> Because I couldn’t compile, I installed the rpms, now I get this:
> 
> /usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
> reference to `pthread\_create’

–  
Sam “Criswell” Hart \<@Sam\_Hart\> AIM, Yahoo!:   
Homepage: \< [http://www.geekcomix.com/snh/](http://www.geekcomix.com/snh/) \>  
PGP Info: \< [http://www.geekcomix.com/snh/contact/](http://www.geekcomix.com/snh/contact/) \>  
Tux4Kids: \< [http://www.geekcomix.com/tux4kids/](http://www.geekcomix.com/tux4kids/) \>

---

<div class="post-metadata">

**Author:** ![Lloyd\_Dupont](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@Lloyd\_Dupont](https://discourse.libsdl.org/u/Lloyd_Dupont)\
**Post date:** [August 27, 2001, 3:14pm UTC](https://discourse.libsdl.org/t/more-problems/4964/3 "2001-08-27T15:14:00Z")

</div>

Samuel Hart wrote:

> > Because I couldn’t compile, I installed the rpms, now I get this:  
> > /usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
> > reference to `pthread\_create’  
> > Not sure if anyone ever responded to this, but it looks like you are missing  
> > the pthreads library. I’m actually shocked, I didn’t think there were any  
> > RPM-based distros anymore that shiped without libpthreads 😉  
> > tss…  
> > one things is sure: you don’t link with pthread ! (the message don’t  
> > list any missing library, but missing function)

so you must link with pthread by adding to your LDFLAGS: -lpthread

---

<div class="post-metadata">

**Author:** ![Joseph\_Carter](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/47e85d/32.png) [@Joseph\_Carter](https://discourse.libsdl.org/u/Joseph_Carter)\
**Post date:** [August 27, 2001, 4:47pm UTC](https://discourse.libsdl.org/t/more-problems/4964/4 "2001-08-27T16:47:01Z")

</div>

Remember the standard installation instructions for most RPMs you find out  
there on the net involve forced ignore all dependencies, which kinda  
defeats the purpose of a package manager but whatever… I’m sure it’s  
there. Installed by default is another question though.On Mon, Aug 27, 2001 at 02:44:28PM -0700, Samuel Hart wrote:

> > Because I couldn’t compile, I installed the rpms, now I get this:
> > 
> > /usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
> > reference to `pthread\_create’
> 
> Not sure if anyone ever responded to this, but it looks like you are missing  
> the pthreads library. I’m actually shocked, I didn’t think there were any  
> RPM-based distros anymore that shiped without libpthreads 😉

–  
Joseph Carter Free software developer

should a bug be marked critical if it only affects one arch?  
 jt: rc for that arch maybe, but those kind of arch  
specific bugs are rare…  
 not when it’s caused by a bug in gcc  
 jt: get gcc removed from that arch. 🙂

-------------- next part --------------  
A non-text attachment was scrubbed…  
Name: not available  
Type: application/pgp-signature  
Size: 273 bytes  
Desc: not available  
URL: [http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20010827/33d34a6b/attachment.pgp](http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20010827/33d34a6b/attachment.pgp)

---

<div class="post-metadata">

**Author:** ![Cameron\_Aycock](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@Cameron\_Aycock](https://discourse.libsdl.org/u/Cameron_Aycock)\
**Post date:** [August 28, 2001, 11:48pm UTC](https://discourse.libsdl.org/t/more-problems/4964/5 "2001-08-28T23:48:00Z")

</div>

As a side question from a newbie in the linux world … what exactly does the  
pthreads library do? Thread management?\> ----- Original Message -----

> From: [sdl-admin@libsdl.org](mailto:sdl-admin@libsdl.org) [mailto:sdl-admin at [libsdl.org](http://libsdl.org)]On Behalf Of  
> Samuel Hart  
> Sent: Monday, August 27, 2001 5:44 PM  
> To: sdl at [libsdl.org](http://libsdl.org)  
> Subject: Re: [SDL] More problems
> 
> On Saturday 25 August 2001 7:25am, David Weisgerber wrote:
> 
> > Because I couldn’t compile, I installed the rpms, now I get this:
> > 
> > /usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
> > reference to `pthread\_create’
> 
> Not sure if anyone ever responded to this, but it looks like you are missing
> 
> the pthreads library. I’m actually shocked, I didn’t think there were any  
> RPM-based distros anymore that shiped without libpthreads 😉
> 
> –  
> Sam “Criswell” Hart AIM, Yahoo!:   
> Homepage: \< [http://www.geekcomix.com/snh/](http://www.geekcomix.com/snh/) \>  
> PGP Info: \< [http://www.geekcomix.com/snh/contact/](http://www.geekcomix.com/snh/contact/) \>  
> Tux4Kids: \< [http://www.geekcomix.com/tux4kids/](http://www.geekcomix.com/tux4kids/) \>
> 
> * * *
> 
> SDL mailing list  
> SDL at [libsdl.org](http://libsdl.org)  
> [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![Gorm\_Lai](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/c6cbf5/32.png) [@Gorm\_Lai](https://discourse.libsdl.org/u/Gorm_Lai)\
**Post date:** [August 29, 2001, 1:45am UTC](https://discourse.libsdl.org/t/more-problems/4964/6 "2001-08-29T01:45:01Z")

</div>

> > Because I couldn’t compile, I installed the rpms, now I get this:
> > 
> > /usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so:  
> > undefined  
> > reference to `pthread\_create’

I am a little confused to when you get this error. Have you searched for the  
libpthread.so in all possible directories? It should be in either /usr/lib og  
/lib directory?  
Maybe you just need to link with the pthreads library in your application. I  
know this because I encountered this same linker error in an application. SDL  
compiled alright, but I had to link with -lpthread to get my application to link  
together (this even though I had -lSDL too)

/Gorm

---

<div class="post-metadata">

**Author:** ![Johann\_Deneux](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/7cd45c/32.png) [@Johann\_Deneux](https://discourse.libsdl.org/u/Johann_Deneux)\
**Post date:** [August 29, 2001, 4:14am UTC](https://discourse.libsdl.org/t/more-problems/4964/7 "2001-08-29T04:14:00Z")

</div>

> As a side question from a newbie in the linux world … what exactly does the  
> pthreads library do? Thread management?

It provides posix-allmost-compliant threads under linux.  
One good way to see what a library contains is to use the  
“nm” command. Coupled with a few lines of shell script, it allows you to  
find what library contains the definition of “that bloody undefined  
reference”.On Tue, 28 Aug 2001, Cameron Aycock wrote:

–  
Johann Deneux

---

<div class="post-metadata">

**Author:** ![Johann\_Deneux](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/7cd45c/32.png) [@Johann\_Deneux](https://discourse.libsdl.org/u/Johann_Deneux)\
**Post date:** [August 29, 2001, 4:25am UTC](https://discourse.libsdl.org/t/more-problems/4964/8 "2001-08-29T04:25:00Z")

</div>

> > > Because I couldn’t compile, I installed the rpms, now I get this:
> > > 
> > > /usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so:  
> > > undefined  
> > > reference to `pthread\_create’
> 
> I am a little confused to when you get this error. Have you searched for the  
> libpthread.so in all possible directories? It should be in either /usr/lib og  
> /lib directory?  
> Maybe you just need to link with the pthreads library in your application. I  
> know this because I encountered this same linker error in an application. SDL  
> compiled alright, but I had to link with -lpthread to get my application to link  
> together (this even though I had -lSDL too)

I used to believe it was possible to include depedencies when building  
shared libraries.  
Anyway, your sdl library should come with a nice little shell script,  
sdl-config, that tells you what flags should be passed to compile and link  
correctly a soft using SDL.On Wed, 29 Aug 2001 gorm at lai.as wrote:

–  
Johann Deneux  
[http://www.esil.univ-mrs.fr/~jdeneux/projects/](http://www.esil.univ-mrs.fr/~jdeneux/projects/)

---

<div class="post-metadata">

**Author:** ![David\_Olofson](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/david_olofson/32/115_2.png) [@David\_Olofson](https://discourse.libsdl.org/u/David_Olofson)\
**Post date:** [August 29, 2001, 4:30am UTC](https://discourse.libsdl.org/t/more-problems/4964/9 "2001-08-29T04:30:59Z")

</div>

Yes. It’s a posix compliant API that allows you to create and manage  
threads (with shared memory and file descriptors, but separate CPU  
contexts and stacks) and various sync constructs.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.  
| Multimedia Application Integration Architecture |  
| A Free/Open Source Plugin API for Professional Multimedia |  
`----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter | `--------------------------------------\> david at [linuxdj.com](http://linuxdj.com) -'On Tuesday 28 August 2001 16:58, Cameron Aycock wrote:

> As a side question from a newbie in the linux world … what exactly  
> does the pthreads library do? Thread management?

---

<div class="post-metadata">

**Author:** ![Paulo\_Pinto](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/p/7cd45c/32.png) [@Paulo\_Pinto](https://discourse.libsdl.org/u/Paulo_Pinto)\
**Post date:** [August 29, 2001, 11:28pm UTC](https://discourse.libsdl.org/t/more-problems/4964/10 "2001-08-29T23:28:01Z")

</div>

Yes. It’s the POSIX API for threads.–  
Paulo Pinto

> ----- Original Message -----  
> From: [cameron@himark.com](mailto:cameron@himark.com) (Cameron Aycock)  
> To:   
> Sent: Tuesday, August 28, 2001 3:58 PM  
> Subject: RE: [SDL] More problems
> 
> > As a side question from a newbie in the linux world … what exactly does  
> > the  
> > pthreads library do? Thread management?
> > 
> > -----Original Message-----  
> > From: sdl-admin at [libsdl.org](http://libsdl.org) [mailto:sdl-admin at [libsdl.org](http://libsdl.org)]On Behalf Of  
> > Samuel Hart  
> > Sent: Monday, August 27, 2001 5:44 PM  
> > To: sdl at [libsdl.org](http://libsdl.org)  
> > Subject: Re: [SDL] More problems
> > 
> > On Saturday 25 August 2001 7:25am, David Weisgerber wrote:
> > 
> > > Because I couldn’t compile, I installed the rpms, now I get this:
> > > 
> > > /usr/lib/gcc-lib/i586-mandrake-linux/2.96/…/…/…/libSDL.so: undefined  
> > > reference to `pthread\_create’
> > 
> > Not sure if anyone ever responded to this, but it looks like you are  
> > missing
> > 
> > the pthreads library. I’m actually shocked, I didn’t think there were any  
> > RPM-based distros anymore that shiped without libpthreads 😉
> > 
> > –  
> > Sam “Criswell” Hart AIM, Yahoo!:   
> > Homepage: \< [http://www.geekcomix.com/snh/](http://www.geekcomix.com/snh/) \>  
> > PGP Info: \< [http://www.geekcomix.com/snh/contact/](http://www.geekcomix.com/snh/contact/) \>  
> > Tux4Kids: \< [http://www.geekcomix.com/tux4kids/](http://www.geekcomix.com/tux4kids/) \>
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)
