This morning, I committed a new revision to my work-in-progress game, blockling. Though I use Linux, I always compile a Windows binary so n00bs can play it too. Ain’t I nice?
This time, however, I got an error:
/opt/mingw/usr/i686-pc-mingw32/lib/libSDLmain.a(SDL_win32_main.o): In
function `console_main':
/opt/mingw/tmp-sdl/SDL-1.2.14/./src/main/win32/SDL_win32_main.c:315:
undefined reference to `_SDL_main' collect2: ld returned 1 exit status
I was completely confused. I had not changed the compilation script, yet it suddenly no longer worked. And I had no reason to suspect my game’s code, since it was compiling perfectly on Linux.
It was at this point that irrational fears began to dance through my head. “Oh no! My mingw cross-compiling environment must have gotten corrupted…somehow!” I thought to myself.
It wasn’t until I had spent over an hour recompiling mingw’s version of gcc and SDL, rearranging compiler flags, and Googling to no avail, that I finally resorted to inspecting my own code.
The first thing I noticed was this:
// int main(int argc, char** argv) {
int main() {
I had grown tired of seeing compiler warnings informing me that I hadn’t used those two variables, so a few days ago I had decided to simply comment that part out for now. And, like I said, it had been working perfectly on Linux.
But apparently SDL on Windows requires the use of those argument parameters. As soon as I put them back, it compiled perfectly.
Yeeaah.
Yet another reason why I don’t use Windows…

Atom 1.0



Warning signs are there for a reason. :) But then again, you're supposed to ignore certain comments and just go along with it when you're programming sometimes, aren't you? Linux has proven to be very good to me as well. Thanks for introducing us! ajaja.
Hooray for Linux! You are welcome =D
JFPCrP Really enjoyed this blog article.Much thanks again. Great.
The Author is crazy..!!
I decided to help and sent a post to the social bookmarks. I hope to raise it in popularity!!....
Thanks a lot for the blog. Want more.
Thank you for your blog. Much obliged.
Yeah, in my opinion, it is written on every fence!!....
Sorry for the off-topic, could you tell where I can get such a nice pattern for my blog ?!....
Develop the topic further! It is interesting to know more details..!!
Not bad post, leave it at my bookmarks!....
Thank you very much! I took it for myself too. Will be useful!!....
Not bad post, leave it at my bookmarks!....
See it for the first time!!....
Sometimes I also see something like this, but earlier I didn`t pay much attention to this!....
Very informative article post.Really looking forward to read more.
I really liked your blog article.Much thanks again. Great.
Great article.Really looking forward to read more. Want more.
I really enjoy the blog post.Thanks Again. Cool.