删除Glut / FreeGlut / GLFW的控制台窗口? [英] Removing console window for Glut/FreeGlut/GLFW?
问题描述
在Visual C ++下,我玩过Glut / FreeGlut / GLFW。这些项目中的每个似乎都默认添加了CMD窗口。我尝试将其删除:
Under Visual C++, I have played around with Glut/FreeGlut/GLFW. It seems that everyone of these projects adds a CMD window by default. I tried removing it going under:
属性-> C / C ++->预处理器->预处理器
定义
Properties->C/C++->Preprocessor->Preprocessor Definitions
在这里,我删除_CONSOLE并替换为_WINDOWS
From here, I remove the _CONSOLE and replace it with _WINDOWS
然后我进入了:
Properties-> Linker-> System-> SubSystem
Properties->Linker->System->SubSystem
然后将选项设置为Windows(/ SUBSYSTEM:WINDOWS)
And I set the option to Windows (/SUBSYSTEM:WINDOWS)
然后,当我尝试在GLFW下编译时,出现以下构建错误:
Then when I try compiling under GLFW, I get the following building errors:
-
错误1错误LNK2001:未解决的
外部符号_WinMain @ 16
MSVCRT.lib
Error 1 error LNK2001: unresolved external symbol _WinMain@16 MSVCRT.lib
错误2致命错误LNK1120:1
无法解析的外部变量glfwWindow.exe
Error 2 fatal error LNK1120: 1 unresolved externals glfwWindow.exe
是否可以删除控制台窗口?
Is it possible to remove the console window?
推荐答案
非控制台Windows应用程序使用 WinMain()
入口点约定。您的Glut示例可能使用标准的C main()
约定。
Non-console Windows applications use the WinMain()
entry point convention. Your Glut examples probably use the standard C main()
convention.
如果您只想针对演示应用程序中,WinAPI函数 FreeConsole()
可能有帮助。
If you want a quick fix just for the demo app, the WinAPI function FreeConsole()
might help.
MSDN:http://msdn.microsoft.com/en-us/library/ms683150(v=vs.85)。 aspx
这篇关于删除Glut / FreeGlut / GLFW的控制台窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!