0
$ make
g++ main.cpp -I/mingw/include -L/mingw/lib -w -Wall -lSDL2main -lSDL2 -o test
/usr/lib/../lib/libmsys-2.0.a(libcmain.o): In function `main':
/msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/lib/libcmain.c:37: undefined reference to `WinMain'
/msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/lib/libcmain.c:37:(.text.startup+0x94): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status
Mingw教程和我的區別是'-lmingw32'選項。如何在MSYS2中設置SDL2?我得到錯誤「未定義的引用'WinMain'」
但MSYS2中沒有'mingw32'文件。
如何解決?
什麼'g ++ --version'輸出? – HolyBlackCat
我的g ++版本是6.3.0。 – Gakgu
謝謝,但還有別的嗎?它是否說它確實是一個mingw版本?我只是想確定一下。 – HolyBlackCat