2016-04-21 98 views
0

我正在爲一個類的程序工作。昨天我的進步到目前爲止工作。 今天我的輸出什麼也沒有顯示。我一直在努力尋找問題 - 並得出結論,NetBeans中肯定發生了一些事情。下面是我爲了測試這個程序而做的一個程序 - 這不是我的課程項目(我希望它很簡單)。C++ Netbeans沒有輸出非常簡單的程序

#include <cstdlib> 
#include <iostream> 

using namespace std; 

int main(int argc, char** argv) { 
    cout<<"anything"<<endl; 
    return 0; 
} 

,如果我去跑>測試項目中,我收到以下輸出:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf 
make[1]: Entering directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation' 
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/cplustribulation.exe 
make[2]: Entering directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation' 
make[2]: 'dist/Debug/Cygwin-Windows/cplustribulation.exe' is up to date. 
make[2]: Leaving directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation' 
make[1]: Leaving directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation' 
"/usr/bin/make" -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-tests-conf 
make[1]: Entering directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation' 
make[1]: *** No rule to make target '.build-tests-conf'. Stop. 
make[1]: Leaving directory '/cygdrive/c/Users/Pietzyk/Desktop/School/CSCI455/labs/NumsTester/cPlusTribulation' 
nbproject/Makefile-impl.mk:67: recipe for target '.build-tests-impl' failed 
make: *** [.build-tests-impl] Error 2 

BUILD TESTS FAILED (exit value 2, total time: 1s) 

我不知道任何這意味着什麼。雖然我假設以「***無規則作爲目標」的界限必須是我的問題的某種指標。我的課堂項目收到了同樣的信息。

當跑到我的輸出是:

成功運行(總時間:79ms)

回答

0

,如果我去跑>測試項目

測試項目需要你確實有測試。你不這樣認爲你的構建失敗。

您應該使用運行/運行項目或生成項目。

或找到這個按鈕Run button

至於輸出:您有項目屬性(右鍵單擊項目名稱)。選擇運行類別。在這裏你有幾個選擇,控制檯類型,在哪裏指導cout。

+0

運行項目提供空白輸出(運行成功除外)。構建輸出狀態構建成功。 – theninja

+0

這不是我所期望的。我期望它輸出:任何東西 – theninja

+0

@theninja請參閱編輯。 –

0

與大多數我的編程困境的 - 這樣一個簡單的解決辦法:

帶我必須有脂肪手指的東西在哪裏運行>設置主項目,我改變了什麼我的主要是。

感謝船長長頸鹿幫助我解決問題並解決這個問題。