Docsity

Setting up a C++ SDL Project in Visual Studio Code, Assignments of Electronics

Toggle sidebar
bg1
Command Line :
g++ main.cpp -IC:\SDL_Project\image-moving\SDL2-2.0.14\x86_64-w64-mingw32\include\SDL2 -IC:\
SDL_Project\image-moving\SDL2_image-2.0.5\x86_64-w64-mingw32\include\SDL2 -LC:\SDL_Project\
image-moving\SDL2-2.0.14\x86_64-w64-mingw32\lib -LC:\SDL_Project\image-moving\SDL2_image-
2.0.5\x86_64-w64-mingw32\lib -w -lmingw32 -lSDL2main -lSDL2 -lSDL2_image
To run it:
.\a.exe
Steps :
1.Crete a folder and open it in vs code
2. copy paste the source code
3. create another folder “.vscode”
i) create tasks.json another file int
ii) create launch.json another file int
4. copy the tasks.json code and launch.json code in both files
5. open task.json and edit the
i) label : “democompile”
ii) command: C:\\Program Files (x86)\\Dev-Cpp\\MinGW64\\bin\\g++.exe
iii) *.cpp
iv) demo.exe
v) -IC:\\SDL_Project\\tutorial6-command\\SDL2-2.0.14\\x86_64-w64-mingw32\\include\\SDL2
vi) -LC: \\SDL_Project\\tutorial6-command\\SDL2-2.0.14\\x86_64-w64-mingw32\\lib
vii) “-mconsole”
6) Open launch.json and edit it
i) Programm: workspace}\\ demo.exe”
pf2

Partial preview of the text

Download Setting up a C++ SDL Project in Visual Studio Code and more Assignments Electronics in PDF only on Docsity!

Command Line : g++ main.cpp -IC:\SDL_Project\image-moving\SDL2-2.0.14\x86_64-w64-mingw32\include\SDL2 -IC:
SDL_Project\image-moving\SDL2_image-2.0.5\x86_64-w64-mingw32\include\SDL2 -LC:\SDL_Project
image-moving\SDL2-2.0.14\x86_64-w64-mingw32\lib -LC:\SDL_Project\image-moving\SDL2_image- 2.0.5\x86_64-w64-mingw32\lib -w -lmingw32 -lSDL2main -lSDL2 -lSDL2_image To run it: .\a.exe Steps : 1.Crete a folder and open it in vs code

  1. copy paste the source code
  2. create another folder “.vscode” i) create tasks.json another file int ii) create launch.json another file int
  3. copy the tasks.json code and launch.json code in both files
  4. open task.json and edit the i) label : “democompile” ii) command: C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\g++.exe iii) *.cpp iv) demo.exe v) -IC:\SDL_Project\tutorial6-command\SDL2-2.0.14\x86_64-w64-mingw32\include\SDL vi) -LC: \SDL_Project\tutorial6-command\SDL2-2.0.14\x86_64-w64-mingw32\lib vii) “-mconsole”
  1. Open launch.json and edit it i) Programm: workspace}\ demo.exe”

ii) debugger path : “C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\gdb.exe” iii) prelaunchtask : “democompile” For Intelliscence CTRL+SHIFT+P -> C/C++ configuration  Mode -  Give Sdl include path (it will create properties file after saving)  SDL delay (100000)