|
From: Jonathan W. <jo...@tp...> - 2006-02-26 22:38:37
|
Matt England wrote: > Why do shared/dynamic library (DLL) builds in mingw/msys with g++ > attempt to resolve all references, even for other libraries? > > Linux systems, on the other hand, don't try to resolve all references > when building shared-object (.so) files (which I understand have some > sort of resemblance to Windows DLLs), but rather the references are > resolved at the time the application that uses said libraries is built. > > Eg, when trying to build (within mingw) a library that uses the bzip2 > module, I get reference errors like this: > > g++ -shared [...a slew of .o files...] libutil.dll > BZipBufferCompressor.o:BZipBufferCompressor.cpp:(.text+0xb39): undefined > reference to `BZ2_bzCompressEnd@4' > [...] > > How can I avoid this the library-build-time reference errors and instead > push the link-time-reference resolution to the time of an application > build? This would also dramatically reduce the size of the .dlls when > reference static libraries (presumably). > > Maybe Windows defines DLLs to be freestanding apps, and hence is > distinctly different then Linux .so files? If so, where can I read more > about this? The only way to do what you want would be to make the libraries in question dll files themselves. |