I don't want a console window!!!

Started by
15 comments, last by Yamian 19 years, 7 months ago
How do I make it so my SDL applications don't use the console window when working with Dev-C++ 5. I tried the "DO not create console window" thing but it's still there.
Advertisement
adding -lmingw32 -mwindows to the linking options, you should always create a win32 project, not a win32 console project.
dont know if this works with Dev C++, but it works with Visual Studio.

just add this line:

#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
FTA, my 2D futuristic action MMORPG
#pragma is MS-specific.
But what if I wanted to make it cross platform. Won't winmain mess with it?
Quote:Original post by White Scorpion
#pragma is MS-specific.
No, it isn't. It's merely compiler-dependent. GCC has its own #pragmas.
BTW there's a "SDL on Dev C" page, you should look at it, it's fairly simple.

http://docs.deninet.com/sdl_on_dev_c.htm
But wouldn't making it a windows application in Dev-C++ make so it only works with windows??? I used that one and there's not a console window but I'm not sure it'll work with other OS's. I'm fine with it being Windows only though.
Worst-case scenario, do a conditional compile to switch between WinMain for Windows targets and main for others. Writing portable code is a bitch; very often it actually requires writing separate code for various platforms and including a mechanism for automatic selection.

Look on the bright side. It used to be that you had to write different code for different compilers to maximize performance - on the same platform!
you don't need to change Winmain or main, SDL do that for you, if you use SDL, you don't need to change a bit of code(well you'll have to tweak a few things) only the way you compile it on each target platform, i.e. linker and compiler options.

This topic is closed to new replies.

Advertisement