How can I compile C++ .cpp files in the Eclipse IDE. I have CDT installed but when I try to execute it, I get a "Launch Failed. Binary not found." I do not want to install CYGWIN unless it is absolutely necessary.
2 に答える
The CDT only provides you with the facilities in Eclipse to edit and understand C files. It does not, to my knowledge, incorporate a compiler (unlike the JDT).
You need to install and configure a C compiler that the CDT can use.
If you're on Linux, you'll probably already have gcc installed that you can use. The only time I ever had to install a C development environment under Windows, I actually used MinGW although you could use Cygwin since it comes with the gcc compiler as well.
I used MinGW since it's only the development suite (hence the "minimalist" in "Minimalist GNU for Windows") whereas Cygwin include all sorts of extra stuff
「起動に失敗しました。バイナリが見つかりません」は、コンパイルできなかったという意味ではなく、コンパイルされたバイナリがIDEで見つからなかったことを意味します。1つの可能性は、コンパイルが失敗した(エラー)ことです。ほとんどの場合、このエラーが発生するのは、(フォルダーのエクスプローラーで)バイナリを右クリックするだけです->実行->ローカルc ++アプリケーションで、正常に実行されます。
システムで動作するコンパイラを接続できるはずです。プロジェクトのプロパティで、C /C++ビルドを確認します。テイクチェーンエディタは、別のコンパイラを接続する場所だと思いますが、私がそうしてから長い時間がかかりました。
これは、MinGWをEclipse(Windowsの場合)で動作させるために使用したCSE 12@UCSDからのリンクです。