Dont want a Console Window

nobody wrote on Thursday, December 07, 2006:

Hi people,

Thanks in advance for any help…

When I run the program all runs very well thanks to GLFW, however, just before the full screen is taken over a small console window appears…

Is there a way to stop this window apperaing??

Thanks

elmindreda wrote on Thursday, December 07, 2006:

The console window appears because you’re building your application for the console subsystem. You need to build it for the Win32 subsystem and it will go away. Note that the linker will then by default be looking for a WinMain() entry point, not a main() one. If you wish to keep your main() entry point, set the entry point to mainCRTStartup under Advanced Linker Settings (assuming you’re using Visual C++).

mrsauce wrote on Thursday, May 28, 2015:

Hi,
I have the same problem with Xcode 6 on my Mac.
In Window 7, for example, I use Code::Blocks and under Project options/Build Targets/select build target options/ I can switch the option from Console Apllication and GUI application. If I select GUI application and run my project I can see only the GLFW window but not the window console.
Is it possibile to do it,or something like that, in Xcode 6 under osx system?

Thank you for eventually reply.
Have a nice day
Fabio

elmindreda wrote on Thursday, May 28, 2015:

If you want your application to output to a terminal, run it from a terminal.

mrsauce wrote on Thursday, May 28, 2015:

“If you want your application to output to a terminal, run it from a terminal.”

Hi Camilla,
I don’t want run my application from a terminal, I don’t want to see the window terminal when I launch my OpenGL-GLFW application for example from my desktop.
When i click on my application on the desktop I want to see only the OpenGL-GLFW window and not a terminal window under.

thank you
Fabio

elmindreda wrote on Thursday, May 28, 2015:

Make a proper application with a bundle and OS X will not open a terminal for it.

mrsauce wrote on Thursday, May 28, 2015:

Hi,
thank’s for the suggestion. I maked a cocoa application bundle but with the main code from my application GLFW and it’s worked properly.

best regards
Fabio

bastiaanolij wrote on Thursday, May 28, 2015:

Yes exactly, there is no real difference between the two, Mac OS X simply requires you to embed your executable within an application bundle that tells it a little more about your app. As soon as you do that you create a click-able application that doesn’t open up a console.

Easiest would be to start with a cocoa application in xCode and gut out all the code and replace it with your own but I’m sure there are tutorials out there how to change a console application project into producing a proper bundle.

(owh, and ps, an application bundle is nothing more then a folder structure with some additional files in it. It is finder that presents it to you as if its a single executable)

mrsauce wrote on Friday, May 29, 2015:

“I’m sure there are tutorials out there how to change a console application project into producing a proper bundle”

Hi Bastiaan,
I searched for this solution to my console application, but i didn’t found nothing sincerely. After the Camilla suggestion , I maked a new Cocoa project, removed all files .m .h inside and I inserted my source code .cpp .h and it’s worked fine. That’s all. I’m sure that is not a clean solution, but for the moment I don’t have other solutions.

Have a nice day
Fabio

bastiaanolij wrote on Friday, May 29, 2015:

Hey Fabio,

Nothing dirty about it, basically you’re doing nothing different then what you would have to do to turn a console application into an application bundle. It is a matter of turning a few switches on and adding a plist file. Starting with a cocoa project and gutting it just gets you to the same point.

Problem for me is that I’ve long since given up on XCode 6 when it comes to these sort of projects, Apple is really pushing you to use their ways which is fine when you only develop for Mac but I feel gets in the way for X-platform stuff. I miss the simplicity of XCode 4:)

For my GLFW projects I generally just use makefiles and create the folder structure needed for a bundle, I’ve been thinking about switching to code::blocks so I wonder what made you switch to xCode?

mrsauce wrote on Friday, May 29, 2015:

Hi Bastiaan,
I tried to use Code::Blocks on my Mac, but sincerely I had some problems with the debug system. I used Code::Blocks under Windows but on OSX I prefer to use and learn Xcode.

Bye
Fabio