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

Author Topic: Help! Can't static link to SFML.  (Read 3568 times)

0 Members and 1 Guest are viewing this topic.

vehem

  • Newbie
  • *
  • Posts: 7
    • View Profile
Help! Can't static link to SFML.
« on: October 28, 2010, 11:07:13 am »
When I compiled the test code in the http://www.sfml-dev.org/tutorials/1.6/start-cb.php I get something like this.

Code: [Select]

-------------- Build: Release in Test ---------------

Linking console executable: bin\Release\Test.exe
C:\CodeBlock AddLibrary\SFML-1.6\lib\mingw/libsfml-system-s.a(Platform.o):Platform.cpp:(.text+0x96): undefined reference to `_Unwind_Resume'
C:\CodeBlock AddLibrary\SFML-1.6\lib\mingw/libsfml-system-s.a(Platform.o):Platform.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
2 errors, 0 warnings
 


By the way I'm using CB 10.05 w/ mingw packaged.  The gcc version is 4.4.1(TDM-2 mingw32) and my "linker settings"->"link libraries" options is "sfml-system-s".

I've used SFML on debian and static linking there is working fine. Oh just remembered is there a way to compile static libraries in linux so that when I link to the libs I don't need to add its dependencies on every projects ei X11, pthreads?

vehem

  • Newbie
  • *
  • Posts: 7
    • View Profile
Help! Can't static link to SFML.
« Reply #1 on: October 29, 2010, 12:34:59 pm »
Anyone? Please help me on this.

priomsrb

  • Newbie
  • *
  • Posts: 38
    • View Profile
Help! Can't static link to SFML.
« Reply #2 on: October 29, 2010, 03:00:39 pm »
Try using gcc 4.5. This solved some of my problems when compiling on windows.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Help! Can't static link to SFML.
« Reply #3 on: October 29, 2010, 03:26:06 pm »
You must use a DW2 version of gcc, not a SJLJ one. Or recompile SFML with your version of the compiler.
Laurent Gomila - SFML developer

vehem

  • Newbie
  • *
  • Posts: 7
    • View Profile
Help! Can't static link to SFML.
« Reply #4 on: October 29, 2010, 07:00:35 pm »
I've installed the TDM-GCC-4.5.1 ( still a SJLJ ), compiled the sfml but I still get the same error coupled with more undefined reference to sfml classes.

@Laurent
Where can I get the DW2 version?

vehem

  • Newbie
  • *
  • Posts: 7
    • View Profile
Help! Can't static link to SFML.
« Reply #5 on: October 29, 2010, 07:03:59 pm »
Changed the order of libraries option from
sfml-system-s
sfml-window-s
to
sfml-window-s
sfml-system-s

and now the undefined reference error is gone but I think it was replaced by a bunch of _Unwind_Resume and __gxx_personality_v0 errors.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Help! Can't static link to SFML.
« Reply #6 on: October 29, 2010, 07:25:52 pm »
Quote
Where can I get the DW2 version?

TDM website has both versions (the DW2 version is not provided as a bundled package, though).

You can also simply install the packaged archive provided in the SFML tutorial for Code::Blocks.

Quote
the undefined reference error is gone but I think it was replaced by a bunch of _Unwind_Resume and __gxx_personality_v0 errors

So you probably didn't properly compile SFML, or you're still using the old one. Can you describe what you did?
Laurent Gomila - SFML developer

vehem

  • Newbie
  • *
  • Posts: 7
    • View Profile
Help! Can't static link to SFML.
« Reply #7 on: October 29, 2010, 08:25:56 pm »
I just execute the build.bat in build\codeblocks\ folder then when I compile the test code I link to the .a libraries under the lib\mingw.

Quote
You can also simply install the packaged archive provided in the SFML tutorial for Code::Blocks.
. Oh ok tnx. Im currently downloading it right now.

vehem

  • Newbie
  • *
  • Posts: 7
    • View Profile
Help! Can't static link to SFML.
« Reply #8 on: October 29, 2010, 08:53:51 pm »
Thank you sirs. It's working now. I'm using the one on the CB/mingw tutorials.