Undefined reference to WinMain@16 when using SDL

冷暖自知 提交于 2019-11-30 18:52:05

I did a little bit of searching for some more information on this error, and I found this page which includes the following informaion:

The only trick in getting this to compile now is to add the include path (eg: -I../SDL/include), the linker path (eg: -L../SDL/lib), and then finally adding the libraries themselves in the right order. Use:

-lmingw32 -lSDLmain -lSDL

Also, don't forget to add the -mwindows flag, if your IDE doesn't add it automatically (in addition to whatever other libraries you want to link). If you don't put them in the right order, you'll get a linker error complaining about the missing symbol WinMain@16.

Try recompiling with those flags above and see whether that makes a difference.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!