I'm having problems with the link pahse of building globecomice program. It's a strange erorr I'm not familure with. I have allready checked the fillowing:
- Rebuild libshout multiple times.
- Checked and redone by ldconfig setup multiple times.
- Checked and rechecked my LD_LIBRARY_PATH setting.
- icecaset and ices is compled and working (I can play OGG's manualy just fine.)
here is the issue, when I run:
gcc -o scripts/globecomice src/globecomice.c -lshout
I get:
/usr/local/lib/libshout.so: undefined reference to `pthread_create'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_rdlock'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_init'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_destroy'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_unlock'
/usr/local/lib/libshout.so: undefined reference to `pthread_detach'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_wrlock'
/usr/local/lib/libshout.so: undefined reference to `pthread_sigmask'
/usr/local/lib/libshout.so: undefined reference to `pthread_join'
/usr/local/lib/libshout.so: undefined reference to `pthread_cond_timedwait'
collect2: ld returned 1 exit status
Any help is appreciated.
Thanks,
Gary
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There's something wrong with your build environment - pthread is posix threads, necessary to build just about any non-trivial program. It's likely that you have the pthread library (otherwise nothing on your system would work), and are just missing the headers necessary to compile programs against the library.
On most distributions, the headers are packaged as part of a package named something like libc6-dev glibc6-devel, etc.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For some reason, mysql defines some pthread functions with the same names as libc does. If that doesn't have anything to do with the solution, I'm stumped :(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-06-14
Ok, finally found my problem. The libshout was compiled with the -pthread option. So the globecomice needs this option also. The working command line is:
gcc -pthread -o scripts/globecomice src/globecomice.c -lshout
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm having problems with the link pahse of building globecomice program. It's a strange erorr I'm not familure with. I have allready checked the fillowing:
- Rebuild libshout multiple times.
- Checked and redone by ldconfig setup multiple times.
- Checked and rechecked my LD_LIBRARY_PATH setting.
- icecaset and ices is compled and working (I can play OGG's manualy just fine.)
here is the issue, when I run:
gcc -o scripts/globecomice src/globecomice.c -lshout
I get:
/usr/local/lib/libshout.so: undefined reference to `pthread_create'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_rdlock'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_init'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_destroy'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_unlock'
/usr/local/lib/libshout.so: undefined reference to `pthread_detach'
/usr/local/lib/libshout.so: undefined reference to `pthread_rwlock_wrlock'
/usr/local/lib/libshout.so: undefined reference to `pthread_sigmask'
/usr/local/lib/libshout.so: undefined reference to `pthread_join'
/usr/local/lib/libshout.so: undefined reference to `pthread_cond_timedwait'
collect2: ld returned 1 exit status
Any help is appreciated.
Thanks,
Gary
There's something wrong with your build environment - pthread is posix threads, necessary to build just about any non-trivial program. It's likely that you have the pthread library (otherwise nothing on your system would work), and are just missing the headers necessary to compile programs against the library.
On most distributions, the headers are packaged as part of a package named something like libc6-dev glibc6-devel, etc.
The header file is /usr/include/pthread.h in most distributions.
I have the .h files.
-rw-r--r-- 1 root root 24681 Mar 19 06:22 /usr/include/pthread.h
As noted above, I don't think I would be able to comple any of the other programs if I didn't.
The erorrs are from the ld process, which I belive is part of linking. I did not get any errors while compiling the libshout libraries.
Gary
For some reason, mysql defines some pthread functions with the same names as libc does. If that doesn't have anything to do with the solution, I'm stumped :(
Ok, finally found my problem. The libshout was compiled with the -pthread option. So the globecomice needs this option also. The working command line is:
gcc -pthread -o scripts/globecomice src/globecomice.c -lshout