User forums > Using Code::Blocks
Compiling a file without a console
Awar:
Hello,
I wish to know if there is a way to compile a program [a single program outside of any project] so that a command console doesn't show up. I know it's possible with a project after setting it's type to GUI application, and it does indeed work. But is it possible without joing a file to an existing project? I tried putting -mwindows in linker settings, but it didn't work.
Specification:
I may have not make myself clear. Putting m-windows does work as it is supposed to. After running the *.exe from outside code::blocks the console does not pop up. What I wanted to know is - Is it possible to tell code::blocs not to display the console while running the program from inside it (by pressing F9 or ctrl+F10). Is there a switch somewhere or is it hardcoded?
Greatwolf:
The console popup will come up if it's run with cb_console_runner.exe. If you have 'Pause when execution ends' checked then that will cause a console popup so it can display execution time.
If you're trying to do this without any projects open(if you just have one source file open by itself) then C::B is just going to run it with cb_console_runner. There doesn't appear to be any way to change that behavior directly. This is not a typical use case in C::B and it sounds like that's what you're looking to do. Why do you want to do this instead of creating a project to go with it?
Awar:
Thx for your answer. As for why? Just for my own comfort. I find working on single files more to my liking, be it me weirdness or just lack of experience to find the advantages of projects. And while working on graphics the console window is just a pain in the neck serving no purpose whatsoever.
oBFusCATed:
Hm, console is great for printf :)
Especially, when debugging animations...
Greatwolf:
you'll have a hard time splitting up multiple source files without a project to go with it. Debugging might not even work either.
Navigation
[0] Message Index
[#] Next page
Go to full version