如何处理Eclipse CDT + Cygwin? [英] How to deal with Eclipse CDT+Cygwin?

查看:208
本文介绍了如何处理Eclipse CDT + Cygwin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我安装了Eclipse Indigo Service Release 2(针对JAVA EE)并安装了CDT 8。然后我用最新版本的gcc,g ++,gdb,make,binutils,automake等安装Cygwin。环境变量PATH正确。

Recently I installed Eclipse Indigo Service Release 2(for JAVA EE) and installed CDT 8 online.Then I installed Cygwin with gcc,g++,gdb,make,binutils,automake,etc at the latest version.I had also made the environment variable PATH correct.

创建一个新的C ++项目(使用Cygwin GCC工具链)是很好的,但是在输入HelloWorld程序后,它会显示许多错误和警告。

Making a new C++ project(using Cygwin GCC toolchain) is just fine,but after typing a HelloWorld program,it shows lots of errors and warings.

使用外部构建器时,错误显示

When using external builder,in error it shows


无法运行程序make:?。

"Cannot run program "make": ?????????¨?".

当使用内部构建器时, / p>

When using internal builder,in conclose it shows


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

"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

错误:无法运行程序g ++:¨?

Error: Cannot run program "g++": ?????????¨?

生成错误,构建已停止

在Windows CMD和Cygwin Terminal,g ++和make都很好。

In both Windows CMD and Cygwin Terminal,g++ and make both work well.

找不到包含库,所以我必须添加路径C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\include\c ++到项目属性 - > C / c ++ Building-> Settings.But之后,错误地,它仍然显示,

What's more,Eclipse can't find the including libraries,so I have to add the path C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\include\c++ to the project properties->C/C++ Building->Settings.But after that, in error,it still shows,


'std'是不明确的

'std' is ambiguous '

'endl'无效的重载

Invalid overload of 'endl'

无法解析符号'cout'

Symbol 'cout' could not be resolved

在项目属性 - > C / C ++ Building->发现选项中,我将Discovery Profile范围设置为每个文件扫描器信息概要文件中的Configeration-wide和Discovery概要文件。 p>

In project properties->C/C++ Building->Discovery Options,I set the Discovery Profile scope as Configeration-wide and Discovery profile as GCC per file scanner info profile.

推荐答案

您必须设置Cygwin工具链,首先使用以下软件包安装Cygwin:

You have to setup a Cygwin toolchain, first of all install Cygwin with the following packages :

binutils
gcc
gcc-core
gcc-g++
gcc-mingw-core
gcc-mingw-g++
make

添加%cygwin%\bin 到您的PATH环境变量,然后打开Eclipse和Cygwin工具链将在您打开一个新的c / cpp项目向导时显示。

Add %cygwin%\bin to your PATH environment variable, then open Eclipse and Cygwin toolchain will be shown when you open a new c/cpp project wizard.

这篇关于如何处理Eclipse CDT + Cygwin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆