Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: nguyendohuuduc on October 08, 2016, 06:02:11 pm

Title: SFML with CodeBlocks 16.01
Post by: nguyendohuuduc on October 08, 2016, 06:02:11 pm
I'm a newbie programmer and having trouble with linking codeblocks 16.01 with the SFML library to the graphics. I have tried multiple guides and multiple versions of sfml but all of them do not work. I'm also using Windows 8 64-bit. The compiler I'm using come with codeblocks by default. Any instruction on how to link the correct version of sfml to codeblocks would be appreciated.
Title: Re: SFML with CodeBlocks 16.01
Post by: stahta01 on October 08, 2016, 06:45:14 pm
Are you using the Code::Blocks (CB) wizard to create the CB project?
Or, are you doing it manually?

Where did you get the SFML library? What version?
Edit: Working on trying it using SFML-2.4.0-windows-gcc-4.9.2-tdm-32-bit and setting up the CB project manually.

I will likely ask you to post a build log in the future. http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Edit: I have NOT used the SFML library (other maybe testing a CB wizard), before.

Tim S.
Title: Re: SFML with CodeBlocks 16.01
Post by: stahta01 on October 08, 2016, 10:55:54 pm
Hand created a project using sample code from here http://www.sfml-dev.org/tutorials/2.4/start-cb.php (http://www.sfml-dev.org/tutorials/2.4/start-cb.php)

You need to be using the TDM's 32 bit GCC 4.9.2 (SJLJ) that was packaged with "codeblocks-16.01mingw-setup.exe".

You need to have downloaded and unzipped "SFML-2.4.0-windows-gcc-4.9.2-tdm-32-bit.zip"

Open up Code::Blocks and setup CB Global variable "sfml" so base points to sfml folder containing sub folders include,lib, and bin.

The after unzipping attached sfml_gcc492.zip open the CB project.

Tim S.