2013-01-08 141 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

相關問題