Sign in to follow this  

Hiding console in SDL app

This topic is 3861 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've taken a long(ish) break from game development, but I'm back at it again. I managed to forget something important, though; in the past I was able to create a Win32 Console app in VS2005 Pro, but was able to create my SDL window with the console in the background hidden. I'm sure there was an option somewhere to turn it off. How do I do that again? Or do I need to create a new normal Win32 non-console app and load my source files into that? Thanks in advance, ukd.

Share this post


Link to post
Share on other sites
Do not create a Win32 console app. There is an option to turn it off, because I made this mistake myself--however, I don't remember how to make the change. If the project is not big, just recreate it as a Win32 Project that's "empty".

Edit: You can try changing a Linker setting in the Project Properties. On the Linker -> System page, there is a field called "SubSystem", set it to "Windows (/SUBSYSTEM:WINDOWS)".

Share this post


Link to post
Share on other sites
As indicated by Maxamor you can modify your link settings. Your current link settings probably look something like this:

kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glut32.lib glu32.lib /nologo /subsystem:console incremental:yes /pdb:"Debug/example.pdb /debug /machine:I386 /out:"Debug/example.exe" /pdbtype:sept

Note the /subsystem:console element. You'll want to change this to the following:

/subsystem:windows /entry:mainCRTStartup

This sets the /subsystem to windows as opposed to console. When this is defined Visual C++ expects to find WinMain() instead of the usual main(). Therefore, if you're using main() then it's necessary to specify the /entry as mainCRTStartup.

Now you have a windows application using the usual main() and no console window.

Share this post


Link to post
Share on other sites

This topic is 3861 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this