开发者

Trying to link SDL in MinGW's G++ is failing miserably.. :/

开发者 https://www.devze.com 2023-04-07 08:41 出处:网络
Late last night I got bored.. so I began writing a small \'Noughts and Crosses\' type game in C++ and SDL. I wrote a fair majority of the basic part of the game, but when I compiled it to check for er

Late last night I got bored.. so I began writing a small 'Noughts and Crosses' type game in C++ and SDL. I wrote a fair majority of the basic part of the game, but when I compiled it to check for errors I got the error message: Undefined reference to WinMain@16; So, "Aah, simply add -lmingw32 should help!", I was thinking.

g++ main.cpp -o nac.exe -lmingw32 -lSDLmain -lSDL -SDL_image

Now it went and gave me this: Undefined reference to SDL_main;

I see no wrong with what I have done, I tried moving -lmingw32 to the right side, middle-left and middle-right just to be sure.. Nada!

I don't think it would be my source code, but just incase: http://pastebin.com/r7fEAkr4 ALso I think I kinda failed with the array defini开发者_如何学编程tion... but I will fix that shortly.

Any help is greatly appreciated! Erkling


Your main function needs this exact signature: int main(int, char**)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号