LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-11-2004, 06:51 AM   #1
Pres
Member
 
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232

Rep: Reputation: 30
pthread_atfork undefined


I'm trying to compile some code which uses openal, but, I get this error :

root@iridium:~/frog# gcc frog.cc -o frog -lGL -lGLU -lSDL -lpthread -lopenal
/usr/local/lib/libopenal.so: undefined reference to `pthread_atfork'
collect2: ld returned 1 exit status

hmm this is my ld.so.conf :

/usr/local/lib
/usr/X11R6/lib
/usr/i486-slackware-linux/lib
/opt/kde/lib
/usr/lib/qt/lib
/usr/lib
ld.so.conf lines 1-6/6 (END)

my gcc info :

root@iridium:/etc# gcc -v
Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.2.3/specs
Configured with: ../gcc-3.2.3/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 3.2.3

here are my pthread libs ...

root@iridium:/lib# ls -l libpthread*
-rwxr-xr-x 1 root root 94112 May 19 2003 libpthread-0.10.so*
lrwxrwxrwx 1 root root 18 Dec 2 12:30 libpthread.so.0 -> libpthread-0.10.so*

root@iridium:/usr/lib# ls -l libpthread*
-rw-r--r-- 1 root root 129728 May 19 2003 libpthread.a
lrwxrwxrwx 1 root root 25 Dec 2 12:30 libpthread.so -> ../../lib/libpthread.so.0*

and in my /usr/include/pthread.h, just to kick me in the face, is the function prototype :

extern int pthread_atfork (void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void)) __THROW;

This is on a slack 9.1, recompiled 2.4.22 kernel.

Anyone got any light to shed ?

Last edited by Pres; 01-11-2004 at 07:40 AM.
 
Old 01-11-2004, 07:38 AM   #2
Pres
Member
 
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232

Original Poster
Rep: Reputation: 30
I just had a look into my libpthread.a and behold it does not have a pthread_atfork function. It includes this however : old_pthread_atfork.o

root@iridium:/usr/lib# find / -name old_pthread_atfork.o -print
root@iridium:/usr/lib#

It's not there.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined reference, why? george_mercury Programming 4 05-07-2009 12:15 AM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 03:01 AM
undefined reference mp4-10 Programming 3 01-25-2005 12:38 PM
utf8_decode undefined Roti Linux - Networking 1 03-10-2004 01:09 AM
$DISPLAY undefined yitzhakbg Linux - Software 2 11-30-2003 05:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration