Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Static Link Errors  (Read 20972 times)

0 Members and 5 Guests are viewing this topic.

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Static Link Errors
« 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)?

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Static Link Errors
« Reply #1 on: November 22, 2013, 01:17:13 pm »
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Static Link Errors
« Reply #2 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]

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Static Link Errors
« Reply #3 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.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Static Link Errors
« Reply #4 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Static Link Errors
« Reply #5 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?
« Last Edit: November 22, 2013, 06:28:07 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Static Link Errors
« Reply #6 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. ::)
Back to C++ gamedev with SFML in May 2023

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Static Link Errors
« Reply #7 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.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

amir ramezani

  • Jr. Member
  • **
  • Posts: 81
  • i'm a programmer who can't see well
    • View Profile
    • download useful software!
    • Email
Re: Static Link Errors
« Reply #8 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
if you can't see well, you can't test your applications and operating system well
my game engine:
allegro game creator
my operating system:
AmirOS

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Static Link Errors
« Reply #9 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


Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Static Link Errors
« Reply #10 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.

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Static Link Errors
« Reply #11 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.

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Static Link Errors
« Reply #12 on: November 23, 2013, 02:16:16 pm »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Static Link Errors
« Reply #13 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.
« Last Edit: November 23, 2013, 02:39:39 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Joshua Flynn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: Static Link Errors
« Reply #14 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.