最近我安装了Eclipse Indigo Service Release 2(用于JAVA EE),并在线安装了CDT 8。然后我安装了最新版本的Cygwin,包括gcc、g++、gdb、make、binutils、automake等工具,并且设置了正确的环境变量PATH。
使用Cygwin GCC toolchain创建一个新的C++项目很容易,但在编写HelloWorld程序后,显示了很多错误和警告。
在使用外部构建器时,出现以下错误信息:
“Cannot run program "make": ?????????¨?”
在使用内部构建器时,终端会显示以下内容:
"g++ -IC:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\include\c++ -O0 -g3 -Wall -c -fmessage-length=0 -o src\test_cpp.o ..\src\test_cpp.cpp Error: Cannot run program "g++": ?????????¨? Build error occurred, build is stopped"
在Windows CMD和Cygwin Terminal中,g++和make都运行正常。
此外,Eclipse找不到包含的库文件,所以我不得不将路径C:\ cygwin \ lib \ gcc \ i686-pc-cygwin \ 4.5.3 \ include \ c ++添加到项目属性-> C / C ++ Building-> Settings。但是之后,在错误消息中仍然显示:
"'std' is ambiguous ' Invalid overload of 'endl' Symbol 'cout' could not be resolved"
在项目属性-> C / C ++ Building-> Discovery Options中,我将Discovery Profile scope设置为Configeration-wide,并将Discovery profile设置为GCC per file scanner info profile。
使用Cygwin GCC toolchain创建一个新的C++项目很容易,但在编写HelloWorld程序后,显示了很多错误和警告。
在使用外部构建器时,出现以下错误信息:
“Cannot run program "make": ?????????¨?”
在使用内部构建器时,终端会显示以下内容:
"g++ -IC:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\include\c++ -O0 -g3 -Wall -c -fmessage-length=0 -o src\test_cpp.o ..\src\test_cpp.cpp Error: Cannot run program "g++": ?????????¨? Build error occurred, build is stopped"
在Windows CMD和Cygwin Terminal中,g++和make都运行正常。
此外,Eclipse找不到包含的库文件,所以我不得不将路径C:\ cygwin \ lib \ gcc \ i686-pc-cygwin \ 4.5.3 \ include \ c ++添加到项目属性-> C / C ++ Building-> Settings。但是之后,在错误消息中仍然显示:
"'std' is ambiguous ' Invalid overload of 'endl' Symbol 'cout' could not be resolved"
在项目属性-> C / C ++ Building-> Discovery Options中,我将Discovery Profile scope设置为Configeration-wide,并将Discovery profile设置为GCC per file scanner info profile。