I got it working with Visual Studio, but decided that Visual Studio is really clunky and would rather just use VSCode. I've found a bunch of tutorials on doing this for previous versions, installing mingw and creating a Makefile and what not, but not for 2.6.
I spent the entire day trying to figure this out with bits and scraps of info from various sources. I can do a "make" command and it builds a main.exe file, but when I run the file no window shows up. I'm assuming I have the wrong version of something somewhere. Or maybe my previous installation of git bash terminal is messing with something?
Here's what I've done to get this far.
- Installed mingw32 from this installer: https://github.com/niXman/mingw-builds-binaries
Mingw installer options I chose:- Version: 13.1.0
- Thread Model: posix
- Architecture: 32-bit
- Build Revision: rev1
- C Runtime: ucrt
- Directory for Installation: C:/
- Went into the C:/mingw32/bin folder and went to the file "mingw32-make.exe" and renamed it to simply "make.exe"
- From SFML Download page, downloaded: GCC 13.1.0 MinGW (DW2) - 32-bit
- From that SFML download, copied the "lib" and "include" folders into this directory in my project: <project root>/src/
- Added the files from the "/bin" folder in my SFML download into the root directory of my project, next to main.cpp, and Makefile.
- Changed these settings in my VSCode settings file:
- "C_Cpp.default.compilerPath": "C:/mingw32/bin/g++.exe",
- "C_Cpp.default.includePath": ["${workspaceFolder}/**"]
- Added Path variable "C:/mingw32/bin" for my Windows User (not System)
- Added demo code from SFML site to main.cpp in my project, a green circle should pop up when running the program.
- Ran "make" command in VSCode terminal from my project directory. This worked and created a "main.exe" file.
- Ran "./main.exe" from the same place. This seemed to work, there were no errors or messages, but nothing popped up on my screen.
I feel like most of this is correct if I'm actually compiling and running the executable. Maybe I chose the wrong mingw installation? Can anyone advise on what I'm doing wrong?