[英]Configure Eclipse CDT to use g++
我安裝了cygwin,我想在Windows 7下使用Eclipse和CDT進行開發。 但是,我收到以下錯誤:
**** Build of configuration Default for project hello_cpp ****
make all
g++ -O2 -g -Wall -fmessage-length=0 -c -o hello_cpp.o hello_cpp.cpp
process_begin: CreateProcess(C:\cygwin\bin\g++.exe, g++ -O2 -g -Wall -fmessage-length=0 -c -o hello_cpp.o hello_cpp.cpp, ...) failed.
make (e=5): Access denied.
make: *** [hello_cpp.o] Error 5
**** Build Finished ****
谷歌搜索后我發現C:\\cygwin\\bin\\g++.exe
是一個cygwin符號鏈接,Windows不理解它,我需要直接指向g ++ - 3位置。 我該怎么做?
我認為你做錯了什么,需要重新開始。 剛剛在我的Windows 7上安裝了Cygwin和Eclipse CDT(Indigo),所有這些都可以正常工作並自動魔術。
這是我做的,我認為你需要做的:
gcc
, gcc-g++
和make
(我還安裝了幾個其他東西,比如gcc4
, w32api
但它是可選的) C:\\cygwin\\bin
(或您安裝它的任何地方)添加到Environment PATH
變量中 File -> New Project -> C++ Project
然后選擇Hello World C++ Project
。 您應該在Toolchains
列表中看到Cygwin GCC
。 完成!
構建輸出:
**** Build of configuration Debug for project TestApp ****
make all
Building file: ../src/TestApp.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/TestApp.d" -MT"src/TestApp.d" -o "src/TestApp.o" "../src/TestApp.cpp"
Finished building: ../src/TestApp.cpp
Building target: TestApp.exe
Invoking: Cygwin C++ Linker
g++ -o "TestApp.exe" ./src/TestApp.o
Finished building target: TestApp.exe
**** Build Finished ****
請參閱此鏈接 ,它顯示了如何輕松地為本機開發設置eclipse。 除了設置環境變量之外,一切都在eclipse中完成。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.