#include <pthread.h>
int
main ()
{
pthread_create(0, 0, 0, 0);
;
return 0;
}
./configure tells me this fails and when I try to compile this
program, named thread.c, with this command:
gcc -o thread.exe thread.c -lpthread
I get the following errors:
e:/djgpp/lib/libpthread.a(pth_high.o):pth_high.c:(.text+0x211):
undefined reference to `_sendto'
e:/djgpp/lib/libpthread.a(pth_high.o):pth_high.c:(.text+0x269):
undefined reference to `_sendto'
e:/djgpp/lib/libpthread.a(pth_high.o):pth_high.c:(.text+0x4a9):
undefined reference to `_recvfrom'
e:/djgpp/lib/libpthread.a(pth_high.o):pth_high.c:(.text+0xd0f):
undefined reference to `_accept'
e:/djgpp/lib/libpthread.a(pth_high.o):pth_high.c:(.text+0xef5):
undefined reference to `_connect'
e:/djgpp/lib/libpthread.a(pth_high.o):pth_high.c:(.text+0x101e):
undefined reference to `_getsockopt'
e:/djgpp/lib/libpthread.a(pth_high.o):pth_high.c:(.text+0x1809):
undefined reference to `_recv'
collect2: ld returned 1 exit status
What shall I do to get this to compile? I also tried the version in
the current directory but that showed even more undefined references.
Georg
I found that I have to add -lwatt to the command line to make it
compile:
gcc -o thread.exe thread.c -lpthread -lwatt
Georg
Also keep in mind that (for some reason) /beta/pth207b.zip is hard to
build and apparently was (accidentally?) built for 686+ (though /
current/ 's version has no such requirement).
You may also wish to try FSU Pthreads, it doesn't need Watt-32. It was
successfully used by Khusraw for his recent compile of p7zip 9.13:
I had tried that library too, but frankly the library I try to port to
DOS does not seem to work with both versions. I have to make some
further tests to try to locate the reason for that.
The library in p7z913.zip compiles as libgthreads.a and it seemed not
work if just renamed to libpthread.a. The configure files usually just
test for pthread, so the name gthread means that I have to change the
configure file.
Georg
hi georg,
this could maybe be passed as parameters to configure.
and if not, porting may mean changing, anyway ;).
alex
- --
- --
best regards,
alex
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iJwEAQECAAYFAk4apvUACgkQ2nA3WyrfyeOB0wQAodbYciPqJirRSgGShyaFyGMO
aRU7ImAagFeHRdKIUKSgARUbDud49oa7dnLnod7NdBdfYMO3t6JWuRwQ0xGsapSv
MVMXgEF65MDWl6BBcD+PjRRjGmglVwmhRF/LZMFXMnWonXICRjYTUJABALMcVMes
+Hbs5yPGg/5QmuwuZ8g=
=YvbQ
-----END PGP SIGNATURE-----
Well, I don't know if you have to hardcode the change or not (and ./
configure is typically a mess, anyways).
If it helps, the old Minix 2 port of FSU Pthreads includes some
examples (with permission) from _Pthreads Programming_ (Nichols, et
al.) by O'Reilly. So you could try those. But no guarantees, I've
never bothered personally. ;-)
http://minix1.woodhull.com/pub/contrib/champoll.txt
http://minix1.woodhull.com/pub/contrib/champoll.tar.Z