Skip to content

Radigo/cpptest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to build and run on Windows

The goal is to have a lightweight working SDL2 dev environment under windows. It will use g++ builder and the ucrt64 flavor of SDL. They both are available in the msys2 tool chain and can be easily install with minimal effort.

Required:

Procedure

  1. Install msys2 (I use the default location from here: "C:/msys64") and launch msys64.exe
  2. Use pacman in msys64 terminal to get the required build tools and SDL:

pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain

pacman -S mingw-w64-ucrt-x86_64-SDL2

  1. Add msys2 bin location to your User Environment Path:

C:/msys64/ucrt64/bin

  1. Install VScode
  2. Install c/c++ extension pack within VScode

Usage

In order to make VScode use the project build & launch settings you have to excplicitely open the project folder in VScode.

Make sure the following are setup like this:

  • c_cpp_properties.json (generated by c/c++ extension)

Add to include path:

"C:/msys64/ucrt64/include/"

Set "compilerPath":

"C:/msys64/ucrt64/bin/g++.exe"

  • tasks.json (generated after trying to build with VScode)

Set "command":

"C:/msys64/ucrt64/bin/g++.exe"

Add after -o in "args":

"-lSDL2"

"-lSDL2main"

  • launch.json (generated after first "run & debug (ctrl+shift+D)")

Set "miDebuggerPath":

"C:/msys64/ucrt64/bin/gdb.exe"

About

Lightweight c++ SDL environment under Windows

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages