# Eliminate shell window?

**URL:** <https://discourse.glfw.org/t/eliminate-shell-window/354>\
**Category:** support\
**Created:** [May 28, 2005, 5:08pm UTC](https://discourse.glfw.org/t/eliminate-shell-window/354 "2005-05-28T17:08:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 28, 2005, 5:08pm UTC](https://discourse.glfw.org/t/eliminate-shell-window/354/1 "2005-05-28T17:08:03Z")

</div>

**nobody** wrote on [Saturday, May 28, 2005](https://sourceforge.net/p/glfw/discussion/247562/thread/50815dd2/#677e):

Hi, I’m using mingw to compile my glfw programs and I have a problem. I get both my GLFW/OpenGL window, and a DOS window when I run the program. I know there must be a way to get rid of the DOS window but I don’t know how. Can anyone help me out?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 28, 2005, 9:02pm UTC](https://discourse.glfw.org/t/eliminate-shell-window/354/2 "2005-05-28T21:02:11Z")

</div>

**[melekor](https://sourceforge.net/u/melekor/)** wrote on [Saturday, May 28, 2005](https://sourceforge.net/p/glfw/discussion/247562/thread/50815dd2/#677e/d149):

To remove the console window, you have to link your program as a win32 application, not a console one. This means you’ll need to use WinMain() instead of main() and change some compiler option. If you’re using VC++, It’s under project properties-\>linker-\>system-\>subsystem.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [June 1, 2005, 3:15pm UTC](https://discourse.glfw.org/t/eliminate-shell-window/354/3 "2005-06-01T15:15:47Z")

</div>

**nobody** wrote on [Wednesday, June 01, 2005](https://sourceforge.net/p/glfw/discussion/247562/thread/50815dd2/#677e/93af):

Darn. I really wanted to make my program portable. My first priority is making it run on both windows and Linux while only needing to compile it once. Is there a solution that will fix this problem for both Windows and Linux? Thanks for the help.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [June 1, 2005, 4:57pm UTC](https://discourse.glfw.org/t/eliminate-shell-window/354/4 "2005-06-01T16:57:28Z")

</div>

**[epsilondelta](https://sourceforge.net/u/epsilondelta/)** wrote on [Wednesday, June 01, 2005](https://sourceforge.net/p/glfw/discussion/247562/thread/50815dd2/#677e/7d07):

Actually, you shouldn’t have to use “WinMain.” You can use “main” in windows programs, you just don’t have the benefit of accessing the native windows messaging system and structure if you go that route (which you don’t need in glfw anyway).

And you can remove the console window with most compiler systems that I know of. You just have to provide the correct switch to the linker, I believe. In the case of Mingw, I think you use "-mwindows" during the linker step. See the MinGW FAQ at the [www.mingw.org](http://www.mingw.org) site.

-JJR

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [August 9, 2005, 12:27pm UTC](https://discourse.glfw.org/t/eliminate-shell-window/354/5 "2005-08-09T12:27:14Z")

</div>

**nobody** wrote on [Tuesday, August 09, 2005](https://sourceforge.net/p/glfw/discussion/247562/thread/50815dd2/#677e/3e12):

That’s easy, just goto Project options-\>Linker-\>advanced and set the EntryPoint field to mainCRTStartup

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [September 10, 2005, 2:39pm UTC](https://discourse.glfw.org/t/eliminate-shell-window/354/6 "2005-09-10T14:39:28Z")

</div>

**nobody** wrote on [Saturday, September 10, 2005](https://sourceforge.net/p/glfw/discussion/247562/thread/50815dd2/#677e/621c):

Along with mainCRTStartup, /system:console needs to be replaced with /system:windows
