SFML community forums

Help => General => Topic started by: sirckopo on December 21, 2014, 07:01:32 am

Title: Static linking issues
Post by: sirckopo on December 21, 2014, 07:01:32 am
Codeblocks 13.12, SFML 2.1 -> 2.2 x86 (static), Win7 x64. A random project.
Ok, i've just switched to 2.2 and added exactly all the libraries listed in the tutorial. Got errors, moved these libraries after SFML' ones, and...
What the hell is that?
// ... compiling to *.o ...
mingw32-g++.exe -LC:\SFML-2.2\lib -o bin\Release\ckChessie.exe <... *.o ...>  -static-libstdc++ -s  -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -ljpeg -lglew -lfreetype -lopengl32 -lgdi32 -lwinmm
C:\SFML-2.2\lib/libsfml-graphics-s.a(ImageLoader.cpp.obj):ImageLoader.cpp:(.text+0x11204): undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
C:\SFML-2.2\lib/libsfml-system-s.a(String.cpp.obj):String.cpp:(.text+0xb66): undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
C:\SFML-2.2\lib/libsfml-system-s.a(String.cpp.obj):String.cpp:(.text+0xebc): undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
C:\SFML-2.2\lib/libsfml-system-s.a(String.cpp.obj):String.cpp:(.text+0x27c6): undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
C:\SFML-2.2\lib/libsfml-system-s.a(String.cpp.obj):String.cpp:(.text+0x2bd0): undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\SFML-2.2\lib/libsfml-system-s.a(String.cpp.obj): bad reloc address 0x13 in section `.text.unlikely'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation

Some advice, or it is on your side?

God, seems that someone has declared war on static linking...  :-\
Title: AW: Static linking issues
Post by: eXpl0it3r on December 21, 2014, 07:18:08 am
What file did you download for Code::Blocks and what file did you download for SFML?
Title: Re: AW: Static linking issues
Post by: sirckopo on December 21, 2014, 07:26:20 am
What filw did you download for Code::Blocks and what file did you downliad for SFML?

Well, Code::Blocks is without compiler (which is MinGW GCC 4.8.1).
And SFML is "GCC 4.9.2 MinGW (DW2) - 32-bit"...

And I already got that issue. So, gonna update MinGW right now.
Thank you very much for this little draw. brb
Title: Re: Static linking issues
Post by: sirckopo on December 21, 2014, 08:09:21 am
Ok, updated with mingw-w64 4.9.2 x686, changed project options, rebuilt with 2.2, now it works.
Some type and antialiasing issues, though, but it's not that bad.
The topic may be closed now.