SFML community forums

Help => General => Topic started by: Mahi on May 14, 2017, 12:45:54 pm

Title: Help with setting up Code::Blocks project
Post by: Mahi on May 14, 2017, 12:45:54 pm
I've been trying to create an SFML project on Code::Blocks for the whole day now, and I'm really out of ideas, been researching the internet for a lot. I keep getting some error, regardless of how I tune the settings. Here's the errors I'm currently getting (there are 42 lines exactly, they're all similar but different reference):

D:\SFML-2.4.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp|| undefined reference to `glClearColor@16'|
D:\SFML-2.4.2\lib\libsfml-graphics-s.a(RenderTarget.cpp.obj):RenderTarget.cpp|| undefined reference to `glMatrixMode@4'|

Here are the versions I have currently downloaded:

Code::Blocks 16.01
http://www.codeblocks.org/downloads/26
Windows
codeblocks-16.01mingw-setup.exe

SFML 2.4.2
https://www.sfml-dev.org/download/sfml/2.4.2/
Windows
GCC 4.9.2 TDM (SJLJ) - 32-bit

I originally tried the MinGW SFML version, but it gave some linker errors, and I read somewhere that you're supposed to use the TDM (SJLJ) version instead.

Here are my project's current settings:

Search directories (Global)
(http://i.imgur.com/3BltfBi.png)

#defines (Global)
(http://imgur.com/TyphQJz.png)

Linker settings (Debug)
(http://imgur.com/Av386iF.png)

Linker settings (Release)
(http://imgur.com/Mm1y7bI.png)

I've tried messing around with the order and stuff, nothing seems to work  :-\ any ideas?
Title: Re: Help with setting up Code::Blocks project
Post by: eXpl0it3r on May 14, 2017, 03:24:11 pm
As the official and up-to-date SFML tutorial (https://www.sfml-dev.org/tutorials/2.4/start-cb.php) states, you need to link SFML's dependencies when linking statically against SFML.
The tutorial also contains the list of the dependencies for Windows and the correct order.