The following code fails to link uisng gcc-4.4.0-mingw with undefined references:
Compiled/attempted link with:
g++ -D_GLIBCXX_DLL -O0 -g3 -Wall -c -odllmain.o ..\dllmain.cpp
g++ -shared-libgcc -shared -otestdll.dll dllmain.o -lstdc++_s
The problem appears to be that the system headers <exception>,<typeinfo> and <new> use _GLIBCXX_DLL to decorate the exception classes. However those classes are not included in the libstdc++_s.a archive (nor in the libstdc++-6.dll).
A workaround is to remove the decorations from those system headers.
-- Build environment --
Windows XP Pro SP3
Log in to post a comment.