Author Topic: SFML with CodeBlocks 16.01  (Read 6194 times)

nguyendohuuduc

  • Guest
SFML with CodeBlocks 16.01
« 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: SFML with CodeBlocks 16.01
« Reply #1 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

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

Tim S.
« Last Edit: October 08, 2016, 10:38:39 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: SFML with CodeBlocks 16.01
« Reply #2 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

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.
« Last Edit: October 09, 2016, 02:00:24 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org