Undefined reference to WinMain@16 when using SDL

后端 未结 1 431
醉酒成梦
醉酒成梦 2021-01-04 21:31

I\'ve been having a lot of trouble getting everything working so that I can start developing on Windows, as apposed to Linux, which is what I normally use when coding. I\'m

相关标签:
1条回答
  • 2021-01-04 22:16

    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.

    0 讨论(0)
提交回复
热议问题