SFML community forums
Help => General => Topic started by: paulochon on December 31, 2014, 04:33:30 am
-
Hi
Just to bring my 5 penny to the pot...
I just installed SFML and was trying a static compilation (Using Dev-Cpp and 64 bits versions) of the exemple provided in the tut.
i first get into troubles with linkage errors like
D:\SFML-2.2-gcc481-64bit\lib\libsfml-window-s.a(Window.cpp.obj) Window.cpp:(.text+0x16d): undefined reference to `sf::Clock::Clock()'
........................
or
D:\SFML-2.2-gcc481-64bit\lib\libsfml-graphics-s.a(RenderWindow.cpp.obj) RenderWindow.cpp:
(.text+0x385): undefined reference to `glReadPixels'
...................................
After googling on the web ,
- i realized that the importance of the order of lib declaration
- Also i made a mistake using glew instead of glew32
After various trial and error , i finally ended with the right config that could help others
so in the section parameters / Linker section, i added
-lsfml-graphics-s
-lsfml-window-s
-lsfml-system-s
-ljpeg
-lglew32
-lfreetype
-lgdi32
-lopengl32
-lwinmm
in the parameters / C++:
-DSFML_STATIC
and of course, in directories/library dirtectories:
D:\SFML-2.2-gcc481-64bit\lib
and include/library dirtectories:
D:\SFML-2.2-gcc481-64bit\include
everything worked perfectly after that
Hope it ll help
Cheers
Nota: Dont know why Dev-cpp uses this kind of declaration , instead of just
sfml-graphics-s
sfml-window-s
sfml-system-s
jpeg
...
-
The -l is the option you would pass to a command line compiler like gcc. All IDEs eventually run a compiler with some messy command line so I guess Dev-Cpp simply decided the -l's should be present in its GUI as well.
Aside from that, this looks like a summary of what the official tutorials say. I know there isn't a tutorial specifically for Dev-Cpp, but was there anything particularly confusing or misleading about the existing tutorials that prompted you to write this post? Or was it just that difficult to adapt those directions to Dev-Cpp?
-
Yep u right, its a wrap up but its more a help for Dev-Cpp guys since the tut provided led me to errors.
I followed the tut on code:blocks but at first i just put the 3 lib (graphic, window, system) and thought it was enough. then I added the missing lib (jpeg, freetype. etc...) but got still errors due to the fact that the tut was giving glew , instead of glew32 and also i was putting those extra lib before the sfml-xxx libs instead of after them. So before reaching the right config i got errors and was trying different combinations, that the purpose of my post , to provide the right config for the guys in the same situation.
Cheers
-
Well, I for one appreciate it. The setup tutorial should really give the full order of linking for all modules.
I thought I would quick search the forums here before playing shuffle myself to see if someone else had the same order issue. Voila! Someone did, thanks paulochon.