SFML community forums

Help => General => Topic started by: Joshua Flynn on November 22, 2013, 01:10:38 pm

Title: Static Link Errors
Post by: Joshua Flynn on November 22, 2013, 01:10:38 pm
I've got Code::Blocks running GCC, and for some time now, the system has been figured to work dynamically (notably the SFML files were copied into the /include directory of the given compiler).

However, I've encountered an error (I'm operating an earlier revision of SFML, 1.6, and the code presently relies on it, and I have a week to deploy a demonstration program so I can't risk dev environment change to another version) in attempting to link statically.

For some strange reason, my development environment doesn't require I include the SFML linker settings under project build settings for the dynamic system - it just works (I believe this is crucial point to make in order to solve the problem).


If I add in the following linker settings to make it static:

-lsfml-network-s
-lsfml-audio-s
-lsfml-graphics-s
-lsfml-window-s
-lsfml-system-s

The code refuses to compile and throws up a series of errors, similar to this:

Code: [Select]
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| multiple definition of `sf::Sprite::Sprite()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000127.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| multiple definition of `sf::Sprite::SetImage(sf::Image const&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000125.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::Image()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000075.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::~Image()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000080.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::LoadFromFile(std::string const&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000060.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Color.o):Color.cpp|| multiple definition of `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000053.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::~Drawable()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000162.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::SetColor(sf::Color const&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000151.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::Close()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000016.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::IsOpened() const'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000059.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::GetEvent(sf::Event&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000023.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::Display()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000019.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(VideoMode.o):VideoMode.cpp|| multiple definition of `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000045.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.text$_ZN2sf6SpriteD0Ev[sf::Sprite::~Sprite()]+0x15d)||undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| more undefined references to `_Unwind_Resume' follow|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Drawable.o):Drawable.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| more undefined references to `_Unwind_Resume' follow|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(GraphicsContext.o):GraphicsContext.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|

Complaining of 'multiple definitions'.

Somehow, I suspect there's a conflict between the dynamic libraries and the static libraries, IE the dynamic library is already available by default (but I don't know how, as there's no configured settings for it: it's just added to the compiler /include folder etc etc) and the static tries to redefine the pre-existing definitions.

How on earth do I solve this problem and get it to link this specific project statically (without changing the entire dev environment and thus ruining the other dynamically linked projects)?
Title: Re: Static Link Errors
Post by: binary1248 on November 22, 2013, 01:17:13 pm
http://en.sfml-dev.org/forums/index.php?topic=12552.0

Paste build output.
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 22, 2013, 03:24:18 pm
http://en.sfml-dev.org/forums/index.php?topic=12552.0

Paste build output.

It's like there, above, in the post.

The code refuses to compile and throws up a series of errors, similar to this:

Code: [Select]
[b]c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| multiple definition of `sf::Sprite::Sprite()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000127.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| multiple definition of `sf::Sprite::SetImage(sf::Image const&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000125.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::Image()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000075.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::~Image()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000080.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::LoadFromFile(std::string const&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000060.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Color.o):Color.cpp|| multiple definition of `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000053.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::~Drawable()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000162.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::SetColor(sf::Color const&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000151.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::Close()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000016.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::IsOpened() const'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000059.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::GetEvent(sf::Event&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000023.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::Display()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000019.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(VideoMode.o):VideoMode.cpp|| multiple definition of `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000045.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.text$_ZN2sf6SpriteD0Ev[sf::Sprite::~Sprite()]+0x15d)||undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| more undefined references to `_Unwind_Resume' follow|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Drawable.o):Drawable.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| more undefined references to `_Unwind_Resume' follow|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(GraphicsContext.o):GraphicsContext.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|[/b]
Title: Re: Static Link Errors
Post by: binary1248 on November 22, 2013, 03:27:19 pm
Did you even open the link I posted? Obviously not... if you aren't willing to show a bit of initiative then I can't help you.
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 22, 2013, 06:14:10 pm
Did you even open the link I posted? Obviously not... if you aren't willing to show a bit of initiative then I can't help you.

I was going to save the patronising points but as you're being condescending allow me to retort: if you cannot read the full build output which is copy and pasted in front of you (and I can screenshot the setting which already says full command line output which was set years ago) and do nothing but try to ram a link telling me to do something I've already done, then please leave this thread, because it's clearly beyond your capacity.
Title: AW: Static Link Errors
Post by: eXpl0it3r on November 22, 2013, 06:24:13 pm
Those are the errors the linker returns, what we need is the command that calls thd compiler (gcc) and linker (ld), if you can show me where they can be found in your paste, I'll gladly take a look. ;)

Looking at the errors it seems you're using libraries that are incompatible with your compiler. What version did you download?
Title: Re: Static Link Errors
Post by: FRex on November 22, 2013, 06:28:19 pm
Quote
The idea is that, by default, most IDEs tend not to output the full command line that invokes the compiler and linker.

c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| multiple definition of `sf::Sprite::Sprite()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000127.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| multiple definition of `sf::Sprite::SetImage(sf::Image const&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000125.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::Image()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000075.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::~Image()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000080.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::LoadFromFile(std::string const&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000060.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Color.o):Color.cpp|| multiple definition of `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000053.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::~Drawable()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000162.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::SetColor(sf::Color const&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics.a(d000151.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::Close()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000016.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::IsOpened() const'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000059.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::GetEvent(sf::Event&)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000023.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| multiple definition of `sf::Window::Display()'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000019.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(VideoMode.o):VideoMode.cpp|| multiple definition of `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window.a(d000045.o)|| first defined here|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.text$_ZN2sf6SpriteD0Ev[sf::Sprite::~Sprite()]+0x15d)||undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp|| more undefined references to `_Unwind_Resume' follow|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Image.o):Image.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Drawable.o):Drawable.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| more undefined references to `_Unwind_Resume' follow|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(GraphicsContext.o):GraphicsContext.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-window-s.a(Window.o):Window.cpp|| undefined reference to `_Unwind_Resume'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|
 
Not a single linker or compiler invocation is in that log just the errors.

One wise man once said:
Quote
please leave this thread, because it's clearly beyond your capacity.
Best regards. ::)
Title: Re: Static Link Errors
Post by: binary1248 on November 22, 2013, 06:29:18 pm
Hmm I guess it can be quite hard to select the right tab to paste the output from. I don't really know how one can oversee the 3rd picture in that post short of not bothering looking at it in the first place. Your output is clearly from the "Build messages" tab which is why you see the "||" and "|" characters everywhere whereas the post instructs you to paste from the "Build log" tab. I have my reasons for posting such a reply, and please, don't try to get yourself out of this situation by attacking me. All the evidence clearly shows what is already obvious. Like I said, if you don't bother following the very simple instructions which even include pictures with clearly marked red boxes, I don't know how else to help you, short of coming to your computer and doing it in person.
Title: Re: Static Link Errors
Post by: amir ramezani on November 22, 2013, 08:54:04 pm
please add these commands in project settings in the linker section in the linker commands:
Code: [Select]
-static-libgcc
-static-libstdc++
-mthreads
-msse
-mwindows
-Wl,--allow-multiple-definition
-Wl,--enable-runtime-pseudo-reloc
and another thing that i have to say that is you have to link with the Windows libraries and OpenGL and all the libraries that your game or application is depend's on
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 02:01:15 pm
Hmm I guess it can be quite hard to select the right tab to paste the output from. I don't really know how one can oversee the 3rd picture in that post short of not bothering looking at it in the first place. Your output is clearly from the "Build messages" tab which is why you see the "||" and "|" characters everywhere whereas the post instructs you to paste from the "Build log" tab. I have my reasons for posting such a reply, and please, don't try to get yourself out of this situation by attacking me. All the evidence clearly shows what is already obvious. Like I said, if you don't bother following the very simple instructions which even include pictures with clearly marked red boxes, I don't know how else to help you, short of coming to your computer and doing it in person.

Wanted to apologise for snapping at you.

Figured where to look and did most of the legwork. Code::Blocks was applying two project settings (master and local: doesn't help there's no overt distinction between the two), traced back and modified the master settings, removed local.

Setting the SFML libraries to static now 'just' results in numerous unwind resume errors:

Code: [Select]
C:\Users\User\Desktop\C++ Projects\RND CV Project\FlagOps.h||In function 'const bool Push8Bits(uint8_t&, uint8_t, uint8_t, uint8_t)':|
C:\Users\User\Desktop\C++ Projects\RND CV Project\FlagOps.h|107|warning: suggest parentheses around '-' inside '<<'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Music.o):Music.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Music.o):Music.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Music.o):Music.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Music.o):Music.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Music.o):Music.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Music.o):Music.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Sound.o):Sound.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Sound.o):Sound.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Sound.o):Sound.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Sound.o):Sound.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Sound.o):Sound.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Sound.o):Sound.cpp|| more undefined references to `_Unwind_Resume' follow|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Sound.o):Sound.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundStream.o):SoundStream.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundStream.o):SoundStream.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundStream.o):SoundStream.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundStream.o):SoundStream.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundStream.o):SoundStream.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundStream.o):SoundStream.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFile.o):SoundFile.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFile.o):SoundFile.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFile.o):SoundFile.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFile.o):SoundFile.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFile.o):SoundFile.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFile.o):SoundFile.cpp|| more undefined references to `_Unwind_Resume' follow|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFile.o):SoundFile.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp|| more undefined references to `_Unwind_Resume' follow|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(AudioResource.o):AudioResource.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(AudioDevice.o):AudioDevice.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(AudioDevice.o):AudioDevice.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(AudioDevice.o):AudioDevice.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFileOgg.o):SoundFileOgg.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFileOgg.o):SoundFileOgg.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFileOgg.o):SoundFileOgg.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFileOgg.o):SoundFileOgg.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-audio-s.a(Listener.o):Listener.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.text$_ZN2sf6SpriteD0Ev[sf::Sprite::~Sprite()]+0x15d)||undefined reference to `_Unwind_Resume'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 1 warnings ===|

Searches on unwind resume don't produce anything particularly insightful (something about 'Long Jump Short Jump' and 'Dwarf 2' error handling, which I suspect isn't the case here). Curiously, setting specific SFML libraries to static doesn't necessarily resume in unwind resume errors (it seems I can set all except sfml-audio-s before it throws up errors). However, part of the errors clearly include Sprite and Image errors so I don't understand how sfml-audio could affect that?

Libraries are called in correct order, as I know they have to be done in reverse order to the library they rely on.

But in-case you want to check:

Code: [Select]
-static-libgcc
-static-libstdc++
-lsfml-audio-s
-lsfml-network-s
-lsfml-graphics-s
-lsfml-window-s
-lsfml-system-s

Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 02:02:17 pm
please add these commands in project settings in the linker section in the linker commands:
Code: [Select]
-static-libgcc
-static-libstdc++
-mthreads
-msse
-mwindows
-Wl,--allow-multiple-definition
-Wl,--enable-runtime-pseudo-reloc
and another thing that i have to say that is you have to link with the Windows libraries and OpenGL and all the libraries that your game or application is depend's on

I'll add these in, and see if it works, thanks.
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 02:05:39 pm
please add these commands in project settings in the linker section in the linker commands:
Code: [Select]
-static-libgcc
-static-libstdc++
-mthreads
-msse
-mwindows
-Wl,--allow-multiple-definition
-Wl,--enable-runtime-pseudo-reloc
and another thing that i have to say that is you have to link with the Windows libraries and OpenGL and all the libraries that your game or application is depend's on

Added, unwind resume errors still occur. Not sure in what order of precedence they have to be in regards to SFML linker settings.
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 02:16:16 pm
Little closer to the solution: I need to acquire a DW2 (http://en.sfml-dev.org/forums/index.php?topic=3008.msg19647#msg19647) type GCC 4.4 compiler (http://en.sfml-dev.org/forums/index.php?topic=3008.msg19641#msg19641) for Windows.

http://en.sfml-dev.org/forums/index.php?topic=3008.0
http://stackoverflow.com/questions/5604183/adding-compiler-to-codeblocks

Unfortunately, the GCC site is perhaps classically difficult to navigate, and I probably couldn't tell which version is a windows compatible DW2 GCC 4.4 compiler (http://ftp.gnu.org/gnu/gcc/gcc-4.4.0/).
Title: AW: Static Link Errors
Post by: eXpl0it3r on November 23, 2013, 02:32:08 pm
Can I ask again what compiler you are using?

The libraries need to be built with the same compiler as you're compiling your poroject with.
The errors you posted had some version in the path that SFML does not provide binaries for, thus if you didn't compile SFML yourself it will never work.

Given the outdated version I suggest to get one from the MinGw Builds project on sourceforge. If you want a matching compiler for the provided downloads, you'll need either the older TDM compiler (NOT 4.8.x) or the older official MinGW compiler (NOT 4.8.x) depending which SFML package you downloaded.
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 02:56:59 pm
Can I ask again what compiler you are using?

Version 4.4.1.

The libraries need to be built with the same compiler as you're compiling your poroject with.

Libraries were the pre-built ones SFML supplies for windows version.

Also, there's no issue with the .DLLs or dynamic linking, just the statics.

The errors you posted had some version in the path that SFML does not provide binaries for, thus if you didn't compile SFML yourself it will never work.

I'm not sure how separate compilation of SFML factors in with statically linked libraries?

Given the outdated version I suggest to get one from the MinGw Builds project on sourceforge. If you want a matching compiler for the provided downloads, you'll need either the older TDM compiler (NOT 4.8.x) or the older official MinGW compiler (NOT 4.8.x) depending which SFML package you downloaded.

Well, I'm operating 1.6 and according to the forum pages I linked, 1.6 needs 4.4 (but I don't know if that's 4.4.0 or 4.4.1: I'm assuming 4.4.0). Alternately, it could be because I have a SJLJ version and not a DW2 version.

I think a newer version of GCC will just make the problem worse.
Title: Re: Static Link Errors
Post by: wintertime on November 23, 2013, 03:18:08 pm
I think recompiling SFML yourself would get it working faster for you. For example I compiled SFML with the TDM 4.5.2 compiler from the Ruby DevKit once, because I knew there is no way around it to get a compatible version if noone else provides it.
Finding the newest 1.6 compatible commit in git is a tiny bit of extra work though.
Title: Re: Static Link Errors
Post by: eXpl0it3r on November 23, 2013, 03:19:58 pm
Sorry, I forgot you're using SFML 1.6 (too many similar topics), but this is essentially your main issue. SFML 1.6 is very outdated and a conversion to 2.x takes a bit time, but is completely worth it!
Quote from: SFML 1.x branch
This branch is 22 commits ahead and 1206 commits behind master
But since you've already made up your mind... ;)

Back when SFML 1.6 was built, there weren't many options regarding MinGW, heck I think there wasn't even the MinGW-w64 project, thus it's essentially rather easy to find the matching compiler. You can try the installer, maybe it will let you download the old version as well, but you can also get the compiler itself here (http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/Previous%20Release%20gcc-4.4.0/).

Well, I'm operating 1.6 and according to the forum pages I linked, 1.6 needs 4.4 (but I don't know if that's 4.4.0 or 4.4.1: I'm assuming 4.4.0). Alternately, it could be because I have a SJLJ version and not a DW2 version.
Looking at the MinGW directory, I would assume it's 4.4, but SJLJ and DW2 are not compatible as well.

I think a newer version of GCC will just make the problem worse.
Why would you think that? SFML 1.6 (https://github.com/SFML/SFML/tree/sfml1) doesn't have the nice CMake build system, but it has a simple makefile and if you get MSYS as well, you can easily build it.

Finding the newest 1.6 compatible commit in git is a tiny bit of extra work though.
It has its separate branch (https://github.com/SFML/SFML/tree/sfml1).
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 03:45:34 pm
Looking at the MinGW directory, I would assume it's 4.4, but SJLJ and DW2 are not compatible as well.

The SJLJ and DW2 incompatibility is primarily the main problem here. But I can't determine how to determine what the compiler is using.

Why would you think that? SFML 1.6 (https://github.com/SFML/SFML/tree/sfml1) doesn't have the nice CMake build system, but it has a simple makefile and if you get MSYS as well, you can easily build it.

Because 1.6, per Laurent's statement cited in the other post, was built on 4.4. So it's easier if I simply 'tack on' a 4.4 compiler that uses DW2 (per the specification also noted in Laurent's post in the other thread, linked to, other post) into Code::Blocks for the short duration of this task (which is simply getting an SFML program to work on a 64 bit machine and the 1.6 DLLs are 32 bit which means I have to static link the executable), rather than ripping and changing a massive amount of libraries only to break some fundamental code and require maybe months of debugging, and I have less than a week.

So, newer (appeal to novelty is a fallacy, by the way), is not better. If 4.4.0 does the job, then it does the job. Any newer version would probably introduce a new set of errors: we only want to solve the current problem, not upgrade the system. Upgrading the system offers benefits I don't actually need at this stage.

Finding the newest 1.6 compatible commit in git is a tiny bit of extra work though.
It has its separate branch (https://github.com/SFML/SFML/tree/sfml1).

I operate a custom 1.6 SFML build. So Mohammed must go to the mountain.

(Seems to be the solution is quite apparent: DW2 GCC 4.4.0 compiler. I don't see why I have to reinstall and alter an entire codebase just to avoid adding on 'one more' compiler to the many I have. I won't be replacing 4.4.1, just adding 4.4.0 to the list of options in Code::Blocks).


I won't make the jump to the newest SFML library until this laptop dies or goes bust: a lot of the codebase is built for windows on a custom (network tweaked) 1.6 SFML build, and I'm planning to 'jump' to Lubuntu, which will mean a lot of the codebase will be rendered void. So rather than change up now, I'm planning to 'jump' fully to Lubuntu, start up the newest SFML library and then go through the complicated setup and salvage process.


So, away from my design and configuration decisions: how do I tell which of these 4.4.0 compilers are windows compatible and use DW2?:
http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/Previous%20Release%20gcc-4.4.0/
Title: Re: Static Link Errors
Post by: wintertime on November 23, 2013, 03:53:25 pm
Now I think, if I remember correctly, they only provided SJLJ at that stage to avoid the issue of crashes on DW2 exceptions thrown from a callback through a dll back to your program.

Edit: I guess I found something for you to try: http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/Previous/1.905.0/ or http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Old%20Releases/TDM-GCC%204.4%20series/Previous%20Releases/4.4.0-tdm-1%20%28r2%29%20DW2/
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 04:42:27 pm
Now I think, if I remember correctly, they only provided SJLJ at that stage to avoid the issue of crashes on DW2 exceptions thrown from a callback through a dll back to your program.

Edit: I guess I found something for you to try: http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/Previous/1.905.0/ or http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Old%20Releases/TDM-GCC%204.4%20series/Previous%20Releases/4.4.0-tdm-1%20%28r2%29%20DW2/

Thank you, I'll give these a try.
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 05:00:10 pm
No dice, installed the TDM-GCC version supplied and added the DW2 parts, made sure compiler defaulted to the 4.4.0 version, still getting errors:

Code: [Select]

-------------- Build: Release in SelfBuilding ---------------

mingw32-g++.exe  -o "bin\Release\CV Project.exe" obj\Release\main.o  obj\Release\resources.res  -static-libgcc -static-libstdc++ -lsfml-audio-s -lsfml-network-s -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -s  -lpthread -lcomdlg32 -lGdi32
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Music.o):Music.cpp:(.text+0x135): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Music.o):Music.cpp:(.text+0x1ad): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Music.o):Music.cpp:(.text+0x21d): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Music.o):Music.cpp:(.text+0x35a): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Music.o):Music.cpp:(.text+0x4a6): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Music.o):Music.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Sound.o):Sound.cpp:(.text+0x6f2): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Sound.o):Sound.cpp:(.text+0x76a): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Sound.o):Sound.cpp:(.text+0x998): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Sound.o):Sound.cpp:(.text+0xbc4): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Sound.o):Sound.cpp:(.text+0xcba): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Sound.o):Sound.cpp:(.text+0xdb2): more undefined references to `_Unwind_Resume' follow
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Sound.o):Sound.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundStream.o):SoundStream.cpp:(.text+0x2ee): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundStream.o):SoundStream.cpp:(.text+0x35a): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundStream.o):SoundStream.cpp:(.text+0x3ce): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundStream.o):SoundStream.cpp:(.text+0x43a): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundStream.o):SoundStream.cpp:(.text+0x49e): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundStream.o):SoundStream.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFile.o):SoundFile.cpp:(.text+0x19e): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFile.o):SoundFile.cpp:(.text+0x2ad): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFile.o):SoundFile.cpp:(.text+0x3aa): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFile.o):SoundFile.cpp:(.text+0x414): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFile.o):SoundFile.cpp:(.text+0x47c): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFile.o):SoundFile.cpp:(.text+0x4ee): more undefined references to `_Unwind_Resume' follow
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFile.o):SoundFile.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp:(.text+0x3aa): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp:(.text+0x476): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp:(.text+0x569): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp:(.text+0x675): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp:(.text+0x781): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp:(.text+0xc61): more undefined references to `_Unwind_Resume' follow
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundBuffer.o):SoundBuffer.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(AudioResource.o):AudioResource.cpp:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(AudioDevice.o):AudioDevice.cpp:(.text+0x40a): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(AudioDevice.o):AudioDevice.cpp:(.text+0x461): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(AudioDevice.o):AudioDevice.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFileOgg.o):SoundFileOgg.cpp:(.text+0x136): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFileOgg.o):SoundFileOgg.cpp:(.text+0x17a): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFileOgg.o):SoundFileOgg.cpp:(.text+0x1c6): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFileOgg.o):SoundFileOgg.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp:(.text+0x2c2): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp:(.text+0x306): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp:(.text+0x352): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp:(.text+0x859): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(SoundFileDefault.o):SoundFileDefault.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Listener.o):Listener.cpp:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.text+0x941): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.text+0x9fd): undefined reference to `_Unwind_Resume'
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.text$_ZN2sf6SpriteD0Ev[sf::Sprite::~Sprite()]+0x15d): undefined reference to `_Unwind_Resume'
Process terminated with status 1 (0 minutes, 1 seconds)
50 errors, 0 warnings

So I'm stuck, unless someone can figure a way for me to solve the 64-bit problem by another means?
Title: Re: Static Link Errors
Post by: eXpl0it3r on November 23, 2013, 05:42:59 pm
The SJLJ and DW2 incompatibility is primarily the main problem here. But I can't determine how to determine what the compiler is using.
On Windows the smallest change in the version number of GCC makes binaries incompatible as of my experience, although one can always run into lucky cases (with possible time bombs).

Because 1.6, per Laurent's statement cited in the other post, was built on 4.4.
It was not built on GCC 4.4, but it was built with GCC 4.4. SFML doesn't use and has used code that would be "optimized" for a certain compiler. As long as the compiler has proper C++98 support SFML can be built (for now).
With that said, I won't further discuss that part of the topic, it's your decision alone. ;)

I operate a custom 1.6 SFML build. So Mohammed must go to the mountain.
How can you run your own branch while using the official binaries? :o
If you use your own branch then you need to recompile anyways, so the discussion around what compiler to use is essentially useless since you can use which ever you currently have.

So, away from my design and configuration decisions: how do I tell which of these 4.4.0 compilers are windows compatible and use DW2?:
http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/Previous%20Release%20gcc-4.4.0/
I think you still haven't understood what MinGW is. It's first a way to use GCC for Windows, so if one talks about MinGW one mostly always talks about a Windows compiler, and second it's a cross-compiler on Linux, thus if someone actually is talking about something on Linux, then they are still trying to build for Windows. ;)

If you had spent more than two seconds looking at the file list, you'd have noticed that there's only one compiler you're essentially have interest in, namely "c++". If you spent even a bit more, you might have seen the "full" package. So I went ahead and quickly tested it and it's a 4.4.0 compiler with DW2, as seen by calling gcc -v:
Quote from: GCC Version
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.4.0/configure --enable-languages=c,ada,c++,fortran,java,objc,obj-c++ --disable-sjlj-exceptions --enable-shared --enable-libgcj --enable-libgomp --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --prefix=/mingw --with-gmp=/mingw/src/gmp/root --with-mpfr=/mingw/src/mpfr/root --build=mingw32
Thread model: win32
gcc version 4.4.0 (GCC)

Full Package (contains compiler for ada, etc as well): Download (http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/Previous%20Release%20gcc-4.4.0/gcc-full-4.4.0-mingw32-bin-2.tar.lzma/download)
Minimal C++ Packages : c++ bin (http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/Previous%20Release%20gcc-4.4.0/gcc-c%2B%2B-4.4.0-mingw32-bin.tar.gz/download), c++ dll (http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/Previous%20Release%20gcc-4.4.0/gcc-c%2B%2B-4.4.0-mingw32-dll.tar.gz/download), core bin (http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/Previous%20Release%20gcc-4.4.0/gcc-core-4.4.0-mingw32-bin.tar.gz/download), core dll (http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/Previous%20Release%20gcc-4.4.0/gcc-core-4.4.0-mingw32-dll.tar.gz/download)
Title: Re: Static Link Errors
Post by: eXpl0it3r on November 23, 2013, 06:16:15 pm
made sure compiler defaulted to the 4.4.0 version, still getting errors:

Code: [Select]
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Music.o):Music.cpp:(.text+0x135): undefined reference to `_Unwind_Resume'
Why does it still use the MinGW directory for 4.4.1? If you have this a path for the libs in your settings, you might want to change it, since it potentially can confuse the compiler even further when it has the same lib dir twice.

So I'm stuck, unless someone can figure a way for me to solve the 64-bit problem by another means?
64-bit problem?
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 06:34:07 pm
How can you run your own branch while using the official binaries? :o
If you use your own branch then you need to recompile anyways, so the discussion around what compiler to use is essentially useless since you can use which ever you currently have.

The network DLLs were all that I replaced (as that was the only part I was having problems with). But the rest are de facto downloads. But the problem seems to oddly crop up when sfml-audio is turned to -s: but I can't omit it as sound is a fundamental part of the program. I can omit networking (but it'd be nice if I could showcase networking as well).

The network DLLs were compiled with the same compiler, but aren't the problem.

I don't get why Dynamic Link Libraries and their compile process would have anything to do with statically linked libraries, which I assume just compile the code at run time and merge it with the source code?

I think you still haven't understood what MinGW is. It's first a way to use GCC for Windows, so if one talks about MinGW one mostly always talks about a Windows compiler, and second it's a cross-compiler on Linux, thus if someone actually is talking about something on Linux, then they are still trying to build for Windows. ;)

But if you're talking windows compiler, doesn't "cross-compiler on Linux" nullify your point it's "for windows"?

If you had spent more than two seconds looking at the file list, you'd have noticed that there's only one compiler you're essentially have interest in, namely "c++". If you spent even a bit more, you might have seen the "full" package.

Rather than present a direct link to the singular and apparently only obvious file, you decided to present an entire list including unnecessary file references and then berate me when I get confused?

S stands for simple, y'know, not snarky.
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 06:35:12 pm
made sure compiler defaulted to the 4.4.0 version, still getting errors:

Code: [Select]
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../libsfml-audio-s.a(Music.o):Music.cpp:(.text+0x135): undefined reference to `_Unwind_Resume'
Why does it still use the MinGW directory for 4.4.1? If you have this a path for the libs in your settings, you might want to change it, since it potentially can confuse the compiler even further when it has the same lib dir twice.

That's where the SFML libraries are stored.

We've only changed the compiler, not the SFML libraries we're using. I don't see how duplicating the SFML files to the other compiler helps?

Also, it can't get confused: the two compilers reside in two completely different directories.

64-bit problem?

Okay, story in full:
I constructed an SFML program that works fine on my machine (32-bit, Vista), and works fine on another laptop (32-bit, Vista) showing the DOS-esque screen debug data and graphics window, but on a 64-bit (Vista) machine, shows only a static black DOS (it doesn't print any starting messages either, and doesn't report any errors or missing libraries).

If, however, I compile an .exe that DOESN'T use SFML and send it, the program runs fine and displays the message. If I use any kind of SFML code, it doesn't play ball (debug and normal libraries are both available, and it works on the other 32-bit laptop fine, note).

I know that 1.6 has 32 bit DLLs and no 64-bit ones. So my idea is to include the library as statically linked into the main program so it doesn't rely on the external 32-bit libraries and see if that works. Except that is quite obviously easier said than done.
Title: Re: Static Link Errors
Post by: wintertime on November 23, 2013, 07:55:19 pm
Static libraries are basically the same code as dynamic, the only difference is the linking is not postponed until loading. It wont solve an incompatibility.
A 64 bit OS can easily use 32 bit binaries, but if you use 32 bit dll files you need to compile your program in a compatible way, that means as 32bit with a compiler with a compatible ABI. The easiest way to do that is recompile both SFML and your program using the same compiler.
Then if its running on one computer, if you copy the exe and all dll files over to another and make sure it uses these dll files (put them into the same directory or double check the dll files are the only SFML dll files in path), it should work there too.
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 23, 2013, 11:06:35 pm
Static libraries are basically the same code as dynamic, the only difference is the linking is not postponed until loading. It wont solve an incompatibility.
A 64 bit OS can easily use 32 bit binaries, but if you use 32 bit dll files you need to compile your program in a compatible way, that means as 32bit with a compiler with a compatible ABI. The easiest way to do that is recompile both SFML and your program using the same compiler.
Then if its running on one computer, if you copy the exe and all dll files over to another and make sure it uses these dll files (put them into the same directory or double check the dll files are the only SFML dll files in path), it should work there too.

What exactly am I looking to recompile SFML into and what files am I looking to copy where?

The 'Flynn Edition' (FE) version of SFML is compiled 'off-site' (stand alone directory) and the relevant DLLs are simply tacked in with the main program which conventionally is dynamically linked. This is obviously not the case with static linking because it's obviously trying to pull the code from somewhere. What files am I looking to transfer from the FE compile to the compiler's directory?
Title: AW: Re: Static Link Errors
Post by: eXpl0it3r on November 24, 2013, 08:30:09 am
Rather than present a direct link to the singular and apparently only obvious file, you decided to present an entire list including unnecessary file references and then berate me when I get confused?

S stands for simple, y'know, not snarky.
Well then, good luck.
Title: Re: Static Link Errors
Post by: amir ramezani on November 24, 2013, 11:40:41 am
have you downloaded Code::blocks with a MinGW?
if yes, it use's SJLJ
so, you have to download SJLJ version of SFML, not DW2

MinGW is a port to GCC on windows
it is GCC that's compiled for windows
i recommend to upgrade to GCC 4.8
as it's more standard and SFML support's it
and another recommendation is upgrade SFML to version 2.x
as it has many bug fixes and many features than version 1.6

the difference between dynamic and static is:
when you compile your application with a dynamic library, it want to find a dll for it and load the functions from it
while you compile it with a static library, the functions are imported to the application and it does not require a file to be located to path directorys
i recommend you to visit
http://MinGW.org/
and download the latest MinGW and give it's path to Code::Blocks and copy all your libraries and include files and compile your game with it
please note that:
don't replace any library or an include file!
it may destroy the files
because they are incompatible with the previous versions of GCC
Title: Re: Static Link Errors
Post by: Joshua Flynn on November 24, 2013, 03:51:15 pm
Well, after all this madness about compiler changes, writing a load of code, installing stuff that would make the problem worse, there's a hacky solution that actually works:

Code: [Select]
int _Unwind_Resume;
int __gxx_personality_v0;

Append that to the top of the .cpp file allows it to compile because, basically, those two are merely undeclared variables that the system is searching for. THE ONLY TWO VARIABLES, EVER.

I am sure this is breaking something major on the most fundamental levels. but I have ONLY THREE DAYS to get this project done, and you don't throw me what amount to basically two undeclared variables and expect me to run around the houses to solve it.

GOGI
 8)
Title: Re: Static Link Errors
Post by: Mario on November 24, 2013, 09:10:06 pm
@Joshua: You're missing the runtime, which is expected to be statically linked for you. Try adding -static-libgcc -static-libstdc++ to your linker command line.
Title: Re: Static Link Errors
Post by: amir ramezani on November 25, 2013, 12:01:12 pm
i mentioned it
but it doesn't work
his problem have been solved
Title: Re: Static Link Errors
Post by: achpile on June 24, 2014, 12:39:20 am
Excuse me, if I wrong.
Does it normal, that static linkage goes without errors only with "-s-d" libs?

When I'm trying to statically link with "-s" the tons of errors comes to build log:

-- Configuring done
-- Generating done
-- Build files have been written to: D:/untitled2
Linking CXX executable untitled.exe
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x12b): undefined reference to `glDeleteTextures@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x192): undefined reference to `__GLEW_ARB_texture_non_power_of_two'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1c5): undefined reference to `__GLEW_ARB_texture_non_power_of_two'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1fd): undefined reference to `glGetIntegerv@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x44c): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x499): undefined reference to `glTexImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x4c4): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x4ef): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x515): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x53b): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x60f): undefined reference to `glGenTextures@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x74c): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x777): undefined reference to `glGetTexImage@20'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x8e3): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x911): undefined reference to `glGetTexImage@20'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x9f4): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xa3a): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xb3f): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xb86): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xcac): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xcf2): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xea9): undefined reference to `glFlush@0'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xeeb): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xf40): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0xf53): undefined reference to `glFlush@0'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x12bc): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1300): undefined reference to `glTexSubImage2D@36'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x140d): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x145e): undefined reference to `glCopyTexSubImage2D@32'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x156d): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x15bc): undefined reference to `glCopyTexSubImage2D@32'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x16be): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x16e4): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x170a): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x178e): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x17b9): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x17e4): undefined reference to `glTexParameteri@12'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x184a): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1859): undefined reference to `glMatrixMode@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1861): undefined reference to `glLoadIdentity@0'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x186d): undefined reference to `glMatrixMode@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x188c): undefined reference to `glBindTexture@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x193f): undefined reference to `glMatrixMode@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x194d): undefined reference to `glLoadMatrixf@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x195c): undefined reference to `glMatrixMode@4'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x19ba): undefined reference to `glGetIntegerv@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1b72): undefined reference to `glDeleteTextures@8'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj):Texture.cpp:(.text+0x1cb4): undefined reference to `__GLEW_ARB_texture_non_power_of_two'
D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/bin/ld.exe: D:/Qt/Tools/mingw482_32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib\libsfml-graphics-s.a(Texture.cpp.obj): bad reloc address 0x17 in section `.text.unlikely'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\untitled.dir\build.make:88: recipe for target 'untitled.exe' failed
CMakeFiles\Makefile2:62: recipe for target 'CMakeFiles/untitled.dir/all' failed
Makefile:74: recipe for target 'all' failed
mingw32-make[2]: *** [untitled.exe] Error 1
mingw32-make[1]: *** [CMakeFiles/untitled.dir/all] Error 2
mingw32-make: *** [all] Error 2
 

CMake file:
project(untitled)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
SET( CMAKE_CXX_FLAGS  "-DSFML_STATIC" )
SET( CMAKE_EXE_LINKER_FLAGS  "-static-libgcc -static-libstdc++ -static" )

target_link_libraries(untitled sfml-graphics-s sfml-window-s sfml-system-s)
 

Source:
#include <SFML/Graphics.hpp>

int main()
{
    sf::Texture b;
    return 0;
}
 
Title: Re: Static Link Errors
Post by: eXpl0it3r on June 24, 2014, 01:51:48 am
If you link statically you have to link all the dependencies, see here (https://github.com/SFML/SFML/wiki/FAQ#build-link-static).
Title: Re: Static Link Errors
Post by: achpile on June 24, 2014, 06:32:21 am
Wow... Now I've got it ;) Thanks a lot, eXpl0it3r!

Title: Re: Static Link Errors
Post by: Mörkö on June 24, 2014, 07:01:45 am
If you link statically you have to link all the dependencies, see here (https://github.com/SFML/SFML/wiki/FAQ#build-link-static).
I did this and tried to launch the program on another computer, but got an error saying could not launch program because of `missing file msvcp120.dll`

I guess that's a Windows specific issue, and some googling got me an article by Microsoft recommending the developer to build some kind of extracting package or something. I didn't have time to try it yet.
Title: Re: Static Link Errors
Post by: Jesper Juhl on June 24, 2014, 07:30:26 am
Most non-trivial programs built with Visual C++ require the Visual C++ Redistributable Package (containing various runtime libraries) to be installed in order to run. Alternatively you can package the required dll's alongside your application.
See http://msdn.microsoft.com/en-us/library/vstudio/ms235299.aspx