Advertisement

Getting rid of the DOS window

Started by July 16, 2005 02:20 PM
4 comments, last by Vexator 19 years, 2 months ago
After looking throught the first pages of the Redbook, I finally was able to produce my first OpenGL window. However, the DOS window keeps getting the way and I want to know if there's a simple way of showing only the OpenGL window.
Well depends on how you're creating your window. If you're using a library to create your window, in many cases all you need to do is link your program in the windows subsystem. Linker option /subsystem:windows. If you can't find this option for your compiler, create a new project and make sure it's a windows application instead of a console application.
Advertisement
put in -mwindows in the linker and that will get rid of the dos window.
Just one question...where is the linker on Microsoft Visual C++ 6.0?

As for the Win32 Application Project, I keep getting an error saying that it was an unresolved symbol, _WinMain@16. So, I created the program file first, then compile on a workspace.

Thanks for the info by the way.
oh, it's onm MS VC++? I am not sure as I use Dev CPP. Have you tried using Google?
All you have to do is to change one setting.

# Select project->settings from the main menu;
# Select the "Link" tab from the dialog box;
# Select "Output" from the "Category" combo box;
# In the "Entry-point symbol" textbox type "mainCRTStartup"

For an existing console project there is a simple way to transform it into a Win32 application, i.e. to get rid of the console window.

# Follow the steps above to add the entry-point symbol
# In the "Project options" textbox replace "subsystem:console" with "subsystem:windows"

Alternatively just add the following line to the beginning of your c code:


// #pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )

(from lighthouse3d.com)

you should get more familiar with the compiler settings. you can optimize your apps a lot with the right settings :)
Wunderwerk Engine is an OpenGL-based, shader-driven, cross-platform game engine. It is targeted at aspiring game designers who have been kept from realizing their ideas due to lacking programming skills.

blog.wunderwerk-engine.com

This topic is closed to new replies.

Advertisement