Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Esanders323 on December 03, 2011, 07:11:12 pm

Title: Stopping Console from opening
Post by: Esanders323 on December 03, 2011, 07:11:12 pm
I have been following some SDL tutorials and want to get the console not to open.

I know if I got to Project Properites I can make just the GUI open. However, I don't have  a project. Just single files. Is it possible to get the console not to open followed by the GUI/Windows Form and just have the GUI open?

Thanks
Title: Re: Stopping Console from opening
Post by: Alpha on December 03, 2011, 08:22:44 pm
It is always preferable to have a project file, however, there is a hack that should achieve what you are trying to do:
Open Settings->Compiler and debugger...->Other settings (tab), click on Advanced options..., and select "Link object files to console executable" from the Command: drop-down menu.  Change the text in the Command line macro: box from:
Code
$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs
to:
Code
$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs -mwindows
(I am assuming you are working on a Windows computer.)

Please note again that this is not the suggested method (and will lead to unexpected behavior in other matters); you should add the files to a project (http://wiki.codeblocks.org/index.php?title=Creating_a_new_project#Adding_a_pre-existing_file).  This will both provide access to the additional features of Code::Blocks (target-specific settings, debugging, etc.) and manage complicated multi-file builds (that you will have to use later in programming).
Title: Re: Stopping Console from opening
Post by: JackDawson on December 05, 2011, 03:34:32 pm
I have been following some SDL tutorials and want to get the console not to open.

I know if I got to Project Properites I can make just the GUI open. However, I don't have  a project. Just single files. Is it possible to get the console not to open followed by the GUI/Windows Form and just have the GUI open?

Thanks

Keep in mind, the console opens only in Debug mode. Switch from Debug to Release and you will see that the Console does not open. Its just a simple switch setting. That's all it is. The reason FOR the console to be open is because any errors that comes up goes into that. So its for programming purposes. If you do not want it, then switch to Release and you will never see it. Hope that helps.
Title: Re: Stopping Console from opening
Post by: oBFusCATed on December 05, 2011, 03:55:25 pm
JackDawson:
He is not using a project, so there is no debug or release mode. It is only one mode using the default compiler.

Also I'm not sure I understand all the things you said, nor that I think they are true. You can setup your project to open a console in both debug and release mode or any combination you like.