2013-01-08 138 views
1

我正在使用eclipse IDE。我在这里有一些基本的源代码,包括头文件。一直在使用cygwin作为C++编译器。它编译我的应用程序,它不会产生任何错误。但是我看不到IDE控制台上的输出。当我自己运行可执行文件时,它会产生输出。如何配置Eclipse IDE以将输出重定向到IDE控制台?从Eclipse IDE运行C++应用程序

这是我得到的:

15:40:11 **** Incremental Build of configuration Debug for project GetCompiled **** 
make all 
Building target: GetCompiled.exe 
Invoking: Cygwin C++ Linker 
g++ -o "GetCompiled.exe" ./Compiling.o 
cygwin warning: 
    MS-DOS style path detected: D:\Aristotelis\C++\GetCompiled\Debug 
    Preferred POSIX equivalent is: /cygdrive/d/Aristotelis/C++/GetCompiled/Debug 
    CYGWIN environment variable option "nodosfilewarning" turns off this warning. 
    Consult the user's guide for more details about POSIX paths: 
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames 
Finished building target: GetCompiled.exe 


15:40:12 Build Finished (took 702ms) 

选定的应用程序运行: enter image description here

我试图通过选择作为C++应用程序运行从IDE运行的exe文件,但它确实不产生任何输出。 致以问候

+0

有不同的控制台,检查您正在使用哪一个,并尝试其他。 – dutt

回答

0

在每次构建后,Eclipse/CDT不会自动运行您的应用程序。您需要通过菜单运行 - >打开运行 - >运行或使用键盘快捷键Crtl + F11,然后再次检查控制台窗口。

一项高级功能是将您的应用程序设置为后期制作事件。为此,请转到您的Build Settings并找到相应的子菜单,然后在其中键入您的application.exe的名称(现在还没有在我的指尖获得Eclipse)。使用此设置,应用程序将在每次成功构建后自动启动。如果你使用自动化单元测试,这会派上用场。

+0

是的,我创建应用程序后运行该应用程序。执行了上述建议,但它没有任何好处。 – uml

+0

您是否安装了CDT,并且能够运行MinGW而不是Cygwin? Nuwen发行版特别适用于Windows上的Eclipse(它已经编译了Boost),请参阅http://nuwen.net/mingw.html – TemplateRex

+0

就我所见,CDT已成为Eclipse的一部分;它有一些关于CDT的可选择的选择复选框。我创建了一个选择MinGW的新项目,但仍然没有输出。 – uml

相关问题