Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
436 views
in Technique[技术] by (71.8m points)

c++ - How to deal with Eclipse CDT+Cygwin?

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.

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

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

When using internal builder,in conclose it shows

"g++ -IC:cygwinlibgcci686-pc-cygwin4.5.3includec++ -O0 -g3 -Wall -c -fmessage-length=0 -o srcest_cpp.o ..srcest_cpp.cpp

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

Build error occurred, build is stopped

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

What's more,Eclipse can't find the including libraries,so I have to add the path C:cygwinlibgcci686-pc-cygwin4.5.3includec++ to the project properties->C/C++ Building->Settings.But after that, in error,it still shows,

'std' is ambiguous '

Invalid overload of 'endl'

Symbol 'cout' could not be resolved

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...