[英]Setting up Eclipse for C++
我正在嘗試設置eclipse以編譯和運行C ++應用程序。 我正在使用cygwing,我將它添加到Eclipse上的PATH中。 我使用默認的Hello World應用程序創建了一個新項目。
#include "TryingCompile.h"
#include <iostream>
using namespace std;
TryingCompile::TryingCompile() {
// TODO Auto-generated constructor stub
}
TryingCompile::~TryingCompile() {
// TODO Auto-generated destructor stub
}
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
int value;
cin>> value;
cout << value;
return 0;
}
默認情況下沒有提供頭文件,但它仍然沒有輸出但沒有輸出。 然后我添加了頭文件。
#ifndef TRYINGCOMPILE_H_
#define TRYINGCOMPILE_H_
class TryingCompile {
public:
TryingCompile();
virtual ~TryingCompile();
};
#endif /* TRYINGCOMPILE_H_ */
它編譯但沒有輸出。 買方式,二進制文件已經創建。 這是我第一次為C ++設置Eclipse。 順便說一句,當您在Windows cmd窗口中測試cygwin的安裝時,鍵入'g ++ -v'它無法識別該命令。 但是一旦你直接運行cygwin就會產生安裝細節。 有什么問題?
沒有輸出意味着它沒有抱怨,所以一切順利。
也許你必須通過在shell中運行它來執行二進制文件?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.