【发布时间】:2018-05-02 21:46:49
【问题描述】:
我在 Windows 7 64 位机器上使用新安装的 cygwin 和 glut32 库。我正在尝试使用 Eclipse IDE 用 C++ 编写一个测试程序。标准终端程序和测试 GLUT32 程序按预期构建和运行。我正在尝试在我的测试程序的发布版本中隐藏控制台窗口。
我尝试在链接器步骤中使用 -mwindows 标志来抑制控制台窗口,但得到以下信息:
11:15:04 **** Incremental Build of configuration Release for project Test ****
make all
Building file: ../src/Test.cpp
Invoking: Cygwin C++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Test.d" -MT"src/Test.o" -o "src/Test.o" "../src/Test.cpp"
Finished building: ../src/Test.cpp
Building target: Test.exe
Invoking: Cygwin C++ Linker
g++ -L"C:\cygwin\lib" -Xlinker -mwindows -shared -o "Test.exe" ./src/Test.o -lglut32 -lglu32 -lopengl32
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: unrecognised emulation mode: windows
Supported emulations: i386pep i386pe
collect2: error: ld returned 1 exit status
make: *** [makefile:47: Test.exe] Error 1
11:15:05 Build Finished (took 376ms)
我认为支持的仿真语句可能是一个提示。我是否以某种方式使用了错误的编译器?如何在后台不弹出控制台窗口的情况下构建完成的程序?
【问题讨论】:
标签: c++ windows eclipse cygwin freeglut