[Mingw-users] STL and undefined reference to '_abort' etc.
- Date: Wed, 16 Apr 2008 14:54:16 -0700
- From: Zack Morris <zmorris@xxxxxxx>
- Subject: [Mingw-users] STL and undefined reference to '_abort' etc.
Hi All, I got mingw working great with Xcode on Mac. I can run windows executables in Parallels and everything. The problem is, for the life of me, I can't get the c standard library to work. If I just add this to my main.c:
#include <string>
std::string test;
it kills the linker. Right now I am linking with ld and get this output in xcode:
Ld /Users/zmorris/Development/Windows/test-xcode/build/Release/test.exe normal i386
cd /Users/zmorris/Development/Windows/test-xcode
/Developer/usr/bin/g++-4.0 -o /Users/zmorris/Development/Windows/test-xcode/build/Release/test.exe -L/Users/zmorris/Development/Windows/test-xcode/build/Release -L/usr/local/cross-tools/lib -F/Users/zmorris/Development/Windows/test-xcode/build/Release -filelist /Users/zmorris/Development/Windows/test-xcode/build/test.build/Release/test.build/Objects-normal/i386/test.exe.LinkFileList -arch i386 -lddraw -ldxguid -lmsvcrt -lgcc -lstdc++
/Users/zmorris/Development/Windows/test-xcode/build/test.build/Release/test.build/Objects-normal/i386/main.o:main.cpp:(.text+0x66): undefined reference to `__Unwind_SjLj_Register'
/Users/zmorris/Development/Windows/test-xcode/build/test.build/Release/test.build/Objects-normal/i386/main.o:main.cpp:(.text+0xde): undefined reference to `__Unwind_SjLj_Resume'
/Users/zmorris/Development/Windows/test-xcode/build/test.build/Release/test.build/Objects-normal/i386/main.o:main.cpp:(.text+0xe7): undefined reference to `__Unwind_SjLj_Unregister'
/usr/local/cross-tools/bin/../i386-mingw32/lib/libstdc++.a(eh_personality.o): In function `_Z21base_of_encoded_valuehP15_Unwind_Context':
/Users/zmorris/tmp/mingw-3.4.5/gcc-3.4.5-20060117-1/libstdc++-v3/../gcc/unwind-pe.h:122: undefined reference to `_abort'
/Users/zmorris/tmp/mingw-3.4.5/gcc-3.4.5-20060117-1/libstdc++-v3/../gcc/unwind-pe.h:116: undefined reference to `__Unwind_GetTextRelBase'
/Users/zmorris/tmp/mingw-3.4.5/gcc-3.4.5-20060117-1/libstdc++-v3/../gcc/unwind-pe.h:118: undefined reference to `__Unwind_GetDataRelBase'
/Users/zmorris/tmp/mingw-3.4.5/gcc-3.4.5-20060117-1/libstdc++-v3/../gcc/unwind-pe.h:120: undefined reference to `__Unwind_GetRegionStart'
...
I realize I should probably be using mingw instead of ld for the link phase, but I don't think that is the issue here, since everything else works great. Somehow I am either missing an STL lib or I am getting some kind of name mangling. I think it might have something to do with __stdcall, __cdecl, __declspec or something like that, where I have the symbols in my libs but the header files are missing a #define somewhere, so they look for the wrong names.
I have been on a wild good chase for hours now, so I'm just going to list some keywords that might ring a bell for someone:
-lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32
libgcc_eh.a
I am pretty much out of ideas. Thanx for any help you can give me,
--Zack
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users