Windows configuration under SDL2

vc ++

IDE is vs2017 , create an empty project, creating an empty .cpp file, open the project properties

Here after the application, and then SDL.dllcopied to the project directory, otherwise there will be a lack of run-time SDL.dllerrors, and finally perform the following test code

Direct write command line compiler

Download the file in the bin copy of the file in the directory to MinGw in the bindirectory, and then use the command line or makefile to compile the code to run the test

g++ main.cpp -std=c++11 -I(user position)\SDL2-2.0.10\x86_64-w64-mingw32\include -L(user position)\SDL2-2.0.10\x86_64-w64-mingw32\lib -w -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2 -o SDLMain

Guess you like

Origin www.cnblogs.com/codemeta-2020/p/12419561.html