【问题标题】:Cygwin+Eclipse: How does one hide a console window in n OpengGL based program by without getting unrecognized emulation mode error?Cygwin + Eclipse:如何在基于 n OpengGL 的程序中隐藏控制台窗口而不会出现无法识别的仿真模式错误?
【发布时间】: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


    【解决方案1】:

    我无法解释为什么,但是当我在编译步骤而不是链接步骤中使用 -mwindows 标志时,问题就解决了。程序构建没有问题,并且在没有控制台的情况下运行。

    【讨论】:

      猜你喜欢
      • 2010-10-14
      • 2012-08-02
      • 1970-01-01
      • 2011-11-16
      • 2011-04-20
      • 2019-06-21
      • 1970-01-01
      • 2011-04-03
      • 1970-01-01
      相关资源
      最近更新 更多