Author Topic: Stopping Console from opening  (Read 4059 times)

Esanders323

  • Guest
Stopping Console from opening
« 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

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Stopping Console from opening
« Reply #1 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.  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).

Offline JackDawson

  • Multiple posting newcomer
  • *
  • Posts: 37
Re: Stopping Console from opening
« Reply #2 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Stopping Console from opening
« Reply #3 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]