Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
441 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...