SFML community forums
Help => General => Topic started by: Trunks7j on March 17, 2010, 06:38:07 am
-
Hey guys,
I've been coding with SFML (amazing!!) for a while in Eclipse, on windows XP, with minGW as my compiler. I'm trying to switch from the dynamic libraries to static, so i replaced my library table:
sfml-system
sfml-audio
sfml-window
sfml-graphics
with this:
sfml-system-s
sfml-audio-s
sfml-window-s
sfml-graphics-s
However I am now getting many undefined references. Here is a sample of the first few lines.
g++ -orun.exe src\main.o src\Terrain.o src\Static.o src\SoundManager.o src\Scene.o src\Player.o src\ParticleSystem.o src\Level.o src\InputListener.o src\ImageManager.o src\FrameListener.o src\Entity.o src\Editor.o -lsfml-system-s -lsfml-main -lsfml-audio-s -lsfml-window-s -lsfml-graphics-s -llibboost_serialization-mgw34-mt -lSPARK -lSPARK_GL -lSPARK_SFML
/mingw/lib/libsfml-window-s.a(Window.o):Window.cpp:(.text+0x3cb): undefined reference to `sf::Sleep(float)'
/mingw/lib/libsfml-graphics-s.a(RenderWindow.o):RenderWindow.cpp:(.text+0xae5): undefined reference to `glReadPixels@28'
/mingw/lib/libsfml-graphics-s.a(Shape.o):Shape.cpp:(.text+0x6b3): undefined reference to `glDisable@4'
Any ideas? I dont think the other libraries (boost, SPK) are interfering, the problems all come from SFML libraries.
-
Which version of SFML are you using? Did you recompile it?
-
SFML 1.5 stable release, and yes I did make clean before re-compiling.
-
and yes I did make clean before re-compiling
Are you talking about your project, or SFML?
-
Maybe because you kept something like 'SFML_DYNAMIC' ?
-
and yes I did make clean before re-compiling
Are you talking about your project, or SFML?
My project. Why would I recompile SFML 1.5? Should I compile the latest svn and try that?
Maybe because you kept something like 'SFML_DYNAMIC' ?
Is that a preprocessor definition? I don't have any of those set.
-
I'm using Code::Blocks, it's a definition (-D I think ?)
-
He doesn't have to define SFML_DYNAMIC if he's switching to static libraries... ;)
Try to revert the order of libraries in the linker options
sfml-audio-s
sfml-graphics-s
sfml-window-s
sfml-system-s
-
Maybe because you kept something like 'SFML_DYNAMIC' ?
As I said, maybe he did use it, and do not need it anymore.
I don't know if defining SFML_DYNAMIC is "dangerous" while using statis libraries :)
-
He doesn't have to define SFML_DYNAMIC if he's switching to static libraries... ;)
Try to revert the order of libraries in the linker options
sfml-audio-s
sfml-graphics-s
sfml-window-s
sfml-system-s
This solved my issue, thank you. However, its puzzling to me why that worked. I would like to obtain a deeper understanding of the linker.
Also, the update of 1.6 fixed the audio delay bug on windows. Thanks for your work!
-
This solved my issue, thank you. However, its puzzling to me why that worked. I would like to obtain a deeper understanding of the linker.
It's a mystery for me too.
Also, the update of 1.6 fixed the audio delay bug on windows.
:D
Which bug was that?
-
Also, the update of 1.6 fixed the audio delay bug on windows.
:D
Which bug was that?
I'd read about the bug on these forums before. Basically, any time i would play a sound it would have about a 0.3 second delay before playing, which was obviously very noticable. However I only had this problem on windows XP and windows 7, never on OSX. But the problem went away with the 1.6 build of SFML.