Author Topic: CodeBlocks + SFML  (Read 2286 times)

Offline ppnl

  • Single posting newcomer
  • *
  • Posts: 7
CodeBlocks + SFML
« on: January 04, 2023, 12:21:48 am »
I'm a recreational programmer trying to get codeblocks up with SFML. I think I have codeblocks up and am about to try to get SFML going after some sleep. But there are a few minor issues I would like some clarity on.

First, one tutorial set a path to the GCC compiler but another didn't. Is there any reason the path should be set?

Also The tutorials I watched insisted that the gcc version must match the SFML version. My gcc version ffrom the codeblocks executable is:

GCC (X86_64-posix-seh-rev0) 8.1.0

The closest match I found on the SFML 2.5.1 download page was for:

GCC 7.3.0  MinGW (SEH) - 64bit

Are these close enough? I would really like to know before I wade into this.

Thanks for any information and happy new year.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CodeBlocks + SFML
« Reply #1 on: January 04, 2023, 01:13:46 am »
CORRECTION BELOW: It looks like SFML is an C library; so, using an newer version of GCC should be okay.

CSFML is an C library; SFML is often used for the C++ version of the library.

NOTE: If SFML was an C++ library, then using the exact same major.minor version would likely be required.

You do need to match bit size as you did and the Exception Handling SEH to SEH as you did.

I do not know what else could cause an issue.

Edit: The download I looked at was here https://www.sfml-dev.org/download/csfml/
If you wish to use the C++ Library then you likely need to match the GCC major.minor version.

Tim S.
« Last Edit: January 04, 2023, 01:21:44 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

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: CodeBlocks + SFML
« Reply #2 on: January 04, 2023, 10:36:33 am »
The best way for integrating SFML in your projects is compiling it yourself using the same compiler you already have.

See Compiling SFML with CMake for more information.

Offline ppnl

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks + SFML
« Reply #3 on: January 05, 2023, 01:12:44 am »
Yep got it all running, thanks for the input guys. I may try the Cmake thing latter but for now I'm going to look at getting python in this thing.