From: John B. <joh...@ho...> - 2006-11-03 10:46:19
|
>Luke Dunstan wrote: > >----- Original Message ----- >John Brown wrote: > > > Hello All, > > > > I built pthreads statically, using MSYS and "make clean GC-static" > > No errors were generated. > > > > "gcc -DPTW32_STATIC_LIB -o myapp myapp.c -lpthreadGC2" gives undefined > > symbol errors for WSAGetLastError and WSASetLastError, so I have to run > > > > gcc -DPTW32_STATIC_LIB -o myapp myapp.c -lpthreadGC2 -lws2_32 > > > > I am trying to compile a program that depends on pthreads. The configure > > script fails because the do-nothing program that it uses to test for > > pthreads > > does not link. I work around this as described above. > > > > Is it supposed to work like that? That is, even if my main program does > > not > > call > > Winsock2 directly, I have to link to -lws2_32 so that references in > > libpthreadGC2.a > > to Winsock2 functions can be resolved? > >Yes. If you have used MSVC then you may have avoided this using #pragma >comment(lib, ...) feature but as far as I know there is no equivalent for >GCC/binutils. > >Luke > Actually, I see that it applies to static libraries as well. I prefer to build only static libraries so I can take my executables wherever I go without having to know which DLLs are required. fontconfig depends on expat and freetype, which depends on lz. I manually edit the pkgconfig scripts for each library so that it can be successfully detected by the configure script of the calling library. It seems that the calling library contains references to functions in the called library, but not the actual code. Is there a way to copy the actual code from called libraries into the calling library when the calling library is being built, or to make the linker automatically link to the called library? _________________________________________________________________ Try Search Survival Kits: Fix up your home and better handle your cash with Live Search! http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=en-US&source=hmtagline |