0

I have a GLFW and OpenGL program in C++ Visual Studio with a window. The console window popping up whenever I run the program is annoying. How do I remove it? I'm on windows but I don't want to make it windows specific, it should be able to run on other OS's.

7
  • What's the value of the /SUBSYSTEM option in your project? Check under project's Property Pages -> Configuration Properties -> Linker -> System -> SubSystem. Commented Jul 3 at 21:48
  • It is set to Console (/SUBSYSTEM:CONSOLE). Commented Jul 3 at 21:54
  • Well, then set it to Windows (/SUBSYSTEM:WINDOWS). To quote from the docs above: "WINDOWS – The application doesn't require a console, probably because it creates its own windows for interaction with the user." Commented Jul 3 at 21:57
  • When I do that it gives me this error: Severity Code Description File Line Suppression State Details Error LNK2019 unresolved external symbol WinMain referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) D:\repos\Snail Engine\MSVCRTD.lib(exe_winmain.obj) 1 Commented Jul 3 at 21:59
  • 3
    @AseedSecond "I'm on windows but I don't want to make it windows specific, it should be able to run on other OS's" - you can't run the same executable file on multiple platforms. So you have to tailor your project to compile a separate executable for each platform. And on Windows, you would use the WINDOWS subsystem to make your Windows-specific executable avoid the console window. Commented Jul 3 at 22:32

0

Browse other questions tagged or ask your own question.