Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Setup SFML, CMake, MinGW  (Read 900 times)

0 Members and 1 Guest are viewing this topic.

Blank

  • Newbie
  • *
  • Posts: 1
    • View Profile
Setup SFML, CMake, MinGW
« on: August 11, 2023, 06:16:04 am »
Hi, I'm new to game development and trying to setup SFML using this tutorial (https://www.sfml-dev.org/tutorials/2.6/compile-with-cmake.php). Here's what I've done so far:

1. Install MinGW on (https://winlibs.com/) version 13.2.0(32bit)
2. Setup the PATH on System Variables to my "MinGW/bin" location
# I've tested "g++ --version" on CLI and everything's okay

3. Install CMake on (https://cmake.org/download) and chose the latest "Windows i386 Installer"
# I've tested "cmake --version" on CLI and everything's okay

4. I downloaded the SFML "Source Code" under the "All" section(just above HTML Documentation)
5. I extracted it and put it to "C:\SFML-2.6.0" (This folder contain CMakeLists.txt & a bunch of other things)

6. I opened up the CMake GUI(just like the tutorial) and filled this field:
   Where is the source code: C:\SFML-2.6.0
   Where to build the binaries: C:SFML-Build

7. I clicked the "Configure" button(it turns red, which is normal according to the tutorial)
8. I clicked the "Configure" button again(I didn't change anything in the configuration)
9. I clicked the "Generate" button and it filled the "C:\SFML-Build" with a bunch of stuff(there's a "makefile" in this folder)

* This is where it gets confusing for me
10. I opened up the CLI and went to "C:\SFML-Build" directory
11. I ran the "mingw32-make" command
12. Here's the error:(in the screenshot)


Can someone explained what to do?

What I'm planning to do:
- I tried to learn SFML by doing a simple game copycat like Flappy Bird or Tetris
- I planned on using "Sublime Text 3" text editor, MinGW(32bit) compiler, CMake and CLI

* Please do note that I have problem for setting up the environment rather than how to program a game

* And if possible can someone explained what to do after this(running a test code to see if it works)

Thank you for reading this, and hope you have a good day
« Last Edit: August 14, 2023, 09:55:59 am by eXpl0it3r »

Thrasher

  • SFML Team
  • Jr. Member
  • *****
  • Posts: 53
    • View Profile
Re: Setup SFML, CMake, MinGW
« Reply #1 on: August 13, 2023, 10:20:17 pm »
https://github.com/SFML/cmake-sfml-project

Have you tried the CMake template project we wrote?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10895
    • View Profile
    • development blog
    • Email
Re: Setup SFML, CMake, MinGW
« Reply #2 on: August 14, 2023, 09:57:53 am »
You seem to have downloaded the WinLibs UCRT instead of the MSVCRT version.
The pre-built binaries aren't compatible with the different runtime libraries.

Get the MSVCRT version and it should work.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything