CodeLite 5.3 + g++ 4.8.1 - Failure to link with libstdc++
Posted: Thu Nov 14, 2013 8:46 pm
Hello!
I've set up CodeLite 5.3 to use g++ 4.8.1 by defining the following paths:
Include path: "c:\MinGW\include;c:\MinGW\lib\gcc\mingw32\4.8.1\include;c:\MinGW\lib\gcc\mingw32\4.8.1\include-fixed;c:\MinGW\lib\gcc\mingw32\4.8.1\include\c++;c:\MinGW\lib\gcc\mingw32\4.8.1\include\c++\backward;c:\MinGW\lib\gcc\mingw32\4.8.1\include\c++\mingw32;c:\MinGW\mingw32\include"
Libraries path: "c:\MinGW\lib"
Attempting to compile the following code:
Produces these errors:
However, if I comment out the std::string reference, it compiles and runs just fine.
Any clues on how this could be fixed?
I've set up CodeLite 5.3 to use g++ 4.8.1 by defining the following paths:
Include path: "c:\MinGW\include;c:\MinGW\lib\gcc\mingw32\4.8.1\include;c:\MinGW\lib\gcc\mingw32\4.8.1\include-fixed;c:\MinGW\lib\gcc\mingw32\4.8.1\include\c++;c:\MinGW\lib\gcc\mingw32\4.8.1\include\c++\backward;c:\MinGW\lib\gcc\mingw32\4.8.1\include\c++\mingw32;c:\MinGW\mingw32\include"
Libraries path: "c:\MinGW\lib"
Attempting to compile the following code:
Code: Select all
#include <string>
class Test {
std::string mStr;
public:
Test()
{
}
};
int main(int argc, char **argv)
{
Test test;
return 0;
}
Code: Select all
C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 4 -e -f Makefile"
----------Building project:[ Test1 - Debug ]----------
mingw32-make[1]: Entering directory 'd:/Programs/CodeLite/Stas1/Test1'
mingw32-make[1]: Leaving directory 'd:/Programs/CodeLite/Stas1/Test1'
mingw32-make[1]: Entering directory 'd:/Programs/CodeLite/Stas1/Test1'
g++ -c "D:/Programs/CodeLite/Stas1/Test1/main.cpp" -g -O0 -Wall -o ./Debug/main.o -Ic:/MinGW/include -Ic:/MinGW/lib/gcc/mingw32/4.8.1/include -Ic:/MinGW/lib/gcc/mingw32/4.8.1/include-fixed -Ic:/MinGW/lib/gcc/mingw32/4.8.1/include/c++ -Ic:/MinGW/lib/gcc/mingw32/4.8.1/include/c++/backward -Ic:/MinGW/lib/gcc/mingw32/4.8.1/include/c++/mingw32 -Ic:/MinGW/mingw32/include -I. -I.
g++ -o ./Debug/Test1 @"Test1.txt" -Lc:/MinGW/lib -L.
./Debug/main.o:main.cpp:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
c:/MinGW/lib/libstdc++.a(string-inst.o):string-inst.cc:(.text$_ZNSs4_Rep10_M_refcopyEv[__ZNSs4_Rep10_M_refcopyEv]+0x3a): undefined reference to `_Unwind_SjLj_Register'
c:/MinGW/lib/libstdc++.a(string-inst.o):string-inst.cc:(.text$_ZNSs4_Rep10_M_refcopyEv[__ZNSs4_Rep10_M_refcopyEv]+0x57): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: c:/MinGW/lib/libstdc++.a(string-inst.o): bad reloc address 0x57 in section `.text$_ZNSs4_Rep10_M_refcopyEv[__ZNSs4_Rep10_M_refcopyEv]'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Test1.mk:80: recipe for target 'Debug/Test1' failed
mingw32-make[1]: *** [Debug/Test1] Error 1
mingw32-make[1]: Leaving directory 'd:/Programs/CodeLite/Stas1/Test1'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
3 errors, 0 warnings
Any clues on how this could be fixed?