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**)
精彩评论