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