How to statically compile an SDL game on Windows

后端 未结 5 862
温柔的废话
温柔的废话 2020-12-07 22:08

I have been trying to produce a statically linked \"single binary\" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a

5条回答
  •  猫巷女王i
    2020-12-07 22:36

    Environment: VMWare Virtual Machine with Windows 7 x64 and Equipment we Dev c + + build 7.4.2.569, complilador g+ + (tdm-1) 4.6.1

    Once, SDL2-2.0.3 API installed as configuration Dev c ++ is not very clear what I've done as tradition requires command line.

    The first problem is that Windows 7 appears to have changed the methodology and they go to his ball. Inventory. Ref. https://stackoverflow.com/users/464581/cheers-and-hth-alf

    After the first hurdle, SDL_platform.h is that bad, it's down another, I do not remember where I downloaded, but the next does not work in the indicated version.

    We must put SDL2.h ls in the directory of the executable.

    D:\prg_desa\zsdl2>g++ bar.cpp main.cpp -o pepe1 -ID:\SDL2-2.0.3\i686-w64-mingw32\include\SDL2 -LD:\SDL2-2.0.3\i686-w64-mingw32\lib -lmingw32 -lSDL2main -lSDL2 -mwindow

    I've finally compiled and works SDL2 testing.

提交回复
热议问题