Click here to Skip to main content
Email Password   helpLost your password?
Title:       C++ Development using eclipse IDE� Starters guide.
Author:      Boby Thomas P
Email:       bobypt@gmail.com
Environment: Eclipse - Win / Linux
Keywords:    Eclipse, CDT
Level:       Intermediate
Description: This article will guide you to set up CDT plugin to eclipse for C++ development.
Section      C++
SubSection   General

C++ Development using eclipse IDE� Starters guide

Introduction

I was a fulltime user of windows operating systems and Microsoft visual studio products for c/c++ application development. Couple of month's back I started using Linux (Ubuntu breezy). I searched for a good IDE for C++ developments in Linux and found eclipse and its plug in architecture very powerful. I decided to start using Eclipse in Ubuntu and everything worked very well. Then I decided to use the same IDE for windows as well, which will make myself more comfortable with eclipse environment. But I faced few problems while setting up a C++ development environment with eclipse and so I decided to document the same so that others also can get benefit from what I have found out.

Setting up Eclipse CDT C++ IDE

Steps

  1. Download and install latest java runtime environment. (You might be having one. If not install it). You can find it in www.eclipse.org.
  2. Download and extract eclipse to a suitable directory. You can find this also in eclipse website.
  3. Launch eclipse (It will launch without any problems if you have Java runtime environment installed) and add the CDT link in help -> Software updates -> find and install.

Sample image

You will get a dialog where you can specify the eclipse CDT plug in path for installation.

Sample image

Now eclipse will connect to the Internet location specified and install the required components for eclipse CDT. You need to be connected to Internet for this installation. Please read the document in the eclipse CDT location for offline installation. http://www.eclipse.org/cdt/

  1. Now Launch File -> New -> Project and you will get a dialog like this where you can specify C++ project and continue with remaining stuffs.

Sample image

  1. Looks very easy right. Create a new project as usual write a hello world program. And compile it. It wont compile because eclipse expect you to supply the make file required for compilation. Write a simple make file as given below and keep it in the same directory where your c++ source files are kept.

#Make file written by boby Thomas Pazheparampil
#21-5-2006
INCLUDES = -I ./include
 
CC = g++ -g -Wno-deprecated
CFLAGS = -c $(INCLUDES)

all : cmain
 
cmain : cmain.o
            $(CC) cmain.o -o cmain 
cmain.o : cmain.cpp
            $(CC) $(CFLAGS) cmain.cpp 
 
clean :
            rm -f *.o
  1. Now compile again, you will get a message like this "error launching external scanner info generator /GCC -E -P -v -dD eclipse CDT". The reason for this error is, the GCC compiler required for compiling the source files are not present in the windows path location. You confirm this by typing "gcc --version" in command prompt. If you get a message saying command not found, you can be sure that GCC compiler is not available.

Additional tools required for CDT

For running CDT from eclipse, you need to have the following tools.

You can download all these tools from www.MinGW.org. You have to download and install build tools (make), compiler (GCC) and debugger (GDB). You can find all these tools in the location www.cygwin.com also. But I recommend the usage of mingw.

Once you have all the supporting tools available, change few settings in eclipse.

Sample image

Sample image

Sample image

Sample image

Now try debugging again. It should work fine. Wish you a happy coding with eclipse.

Conclusion

Eclipse is free software available in Windows as well as Linux. C++ applications developed in eclipse can be easily taken to any other platforms very easily. Also as a developer, if you are familiar with eclipse development environment, switching from Windows to Linux is no big deal.

</body></html>
You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralMy vote of 1
wuuhuu
10:08 2 Dec '09  
deprecated and outdated!
GeneralThis is soooooooo old...
wuuhuu
10:08 2 Dec '09  
Jeez, guys, this is so old, not applicable anymore to the Eclipse Galileo release. Even after adding CDT and installing MinGW, standard includes aren't recognized. It's a pain!
GeneralThanks a lot
peretog
15:50 7 May '09  
Thanks a lot, very useful for me

Cheers, Mark Denon
GeneralEASIER: JUST DOWNLOAD ECLIPSE C++ IDE and go to HELP, CONTENTS....
mibercicp
18:44 19 Dec '08  
EASIER: JUST DOWNLOAD ECLIPSE C++ IDE and go to HELP, CONTENTS....
GeneralRe: EASIER: JUST DOWNLOAD ECLIPSE C++ IDE and go to HELP, CONTENTS....
anticafe
18:29 22 Aug '09  
I don't know why, but when i use Eclipse C++ to build a project, i get a message "Exec error:Launching failed" although i use Eclipse template C++ ("Hello World") and i haven't modified anything. Can someone help me?
Generalfurther building when I get a compiler-error
piwi133
2:09 19 Sep '08  
hi @all,

does anybody know, if it´s possible to build further wen I get an error during compiling in eclipse?

are there any settings?

greetz
Questiona simple program on EMP [modified]
sireeshakolluri
0:41 9 Apr '08  
hello,I am working on same platform, SDK of Ericsson Mobile Platform on Eclipse.I want a simple display program to get a clear view of the platform.I got the hierarchy but unable to trace the flow of program.Can any who knows it please help me? I am working since two weeks only.In OPA
GUI->Display Mgmt->CCanvas->ICanvas->DrawText.(hierarcy)Confusedwhile coding.




Thanks & Regards,
sireesha

modified on Wednesday, April 9, 2008 5:49 AM

GeneralError trying to debug
hallrd
8:52 2 Oct '06  
While trying to debug a small program I get an Error creating session
Target is not responding (timed out).
I think I have eclipse set up correctly. I followed your tutorial.

Thanks in advance.


AnswerRe: Error trying to debug
woleadetiba
15:38 19 May '07  
Hello,

I had same problem and really battled for like a day before I got a way out.

I found the version of gdb I was running to be GNU gdb 5.2.1. Running Eclipse SDK 3.2.1.

I tried "H:\mingw\bin>gdb C:\development\CPlusPlus\main.exe" to debug from command line it gave this error:

GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...c:/cygmnt/prj/pkg/src/gdb/mingw32

An internal GDB error was detected. This may make further
debugging unreliable. Quit this debugging session? (y or n)

For the solution, I got a newer version of gdb, GNU gdb 6.3. and installed it. That was the magic and debug could work well from eclipse.

Wole

GeneralRe: Error trying to debug
jbperrin
14:36 1 May '08  
I also had various problems debugging using Eclipse on Windows (with mingw and the gdb debugger), particularly with single-stepping not matching up with the correct line in the code and also single-stepping through DirectX code dealing with graphics calls and such. I found the same solution as above: I upgraded from GNU gdb 5.2.1-1 to version 6.3-2 and everything began working great.
General[Message Removed]
nompel
15:58 20 Sep '08  
Spam message removed
QuestionHow-to get C++ online help from Eclipse CDT
phgddr
5:26 28 Aug '06  
I am interested in using Eclipse-CDT as IDE for C++ development but I cannot find any finalized package that would provide C++ online (and possibly contextual) help.
Does anyone now about such a package.
QuestionFailed to make
Michael knafo
0:57 21 Jul '06  
Hello, and thanks for the Article,

i installed all the needed things including MinGw, but i failed compiling the
project, i receive the message " Error launching builder (mingw32-make all )
(Exec error:Launching failed) ", can you please   help with that ?

Knafo Michael
AnswerRe: Failed to make
Boby Thomas P
3:43 21 Jul '06  
Add path to mingw32-make in the TATH variable.
Regards,
boby

Regards,
Boby
GeneralStep-by-step debugger
ed welch
9:46 5 Jun '06  
Interesting artical. I never knew you could do c++ in Eclipse. The most important function for me is step-by-step debugging. How well does this work in comparision to Visual c++?

GeneralMFC support?
mr.scrag
8:15 30 May '06  
I'd like to know if there's a possibility to write applications using MFC with this IDE Confused
Sorry, for my English.
GeneralEclipse Slow?
RichardS
23:23 29 May '06  

Our company is wanting to push Eclipse as a development IDE to save costs on buying licenses for programmes like CodeWright. However, reports are that Eclipse is very slow in doing things that is fast in other IDE's. What is impression in this regard?

thanks,
Rich


"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
GeneralRe: Eclipse Slow?
rpwt
9:48 30 May '06  
I've used Eclipse and CodeWright for several C++ (and Perl, Java) projects. CW is noticeably faster on a limited hardware system, as are many of the earlier-generation text editors. If you have a reasonably generous system (1GB+, 1+Mhz), the penalty is not that significant. There are also a couple of documented tricks to increase the stack space available to Eclipse.

The multi-platform and OSS factors make Eclipse the IDE of choice for my new projects.
GeneralRe: Eclipse Slow?
ralphatcp
0:28 14 Mar '07  
> reports are that Eclipse is very slow

Up until an hour ago I would have agreed. Even doing a simple selection needed 10s of seconds. Most frustrating. Then I did some googling and found that an update to Java 1.5 might help. I updated and I'm pleased to say that Eclipse has woken up.
GeneralRe: Eclipse Slow?
RichardS
0:34 14 Mar '07  

Thanks. I will have a look into the update as I am running build 1.5.0_06-b05.


"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook

GeneralSounds like a useful tool
Jun Du
8:59 25 May '06  
I am doing quite a bit of cross-platform development recently. I'll try it out. Thansk for sharing it with us.

- It's easier to make than to correct a mistake.
GeneralRe: Sounds like a useful tool [modified]
Boby Thomas P
9:35 25 May '06  
This help is specific for windows. Linux machine, you just need to install CDT plugin for eclipse as most of the make, compiles are debuggers are there with most of the linux distribution.(You might be knowing this Smile ) But again the operatios remain the same.
Its very easy in Linux.

Regards,
Boby

-- modified at 15:44 Thursday 25th May, 2006
GeneralRe: Sounds like a useful tool [modified]
Vertyg0
3:26 26 May '06  
You sure www.MinGW.com is right link ?
I`ll rather say its http://www.mingw.org/ that .com page is so Chinese and goofy Big Grin (I have nothing against China people)
GeneralRe: Sounds like a useful tool [modified]
Boby Thomas P
4:19 26 May '06  
I am sorry. You are right. It is http://www.mingw.org/

Thank you

Regards,
Boby
GeneralRe: Sounds like a useful tool
Jun Du
5:33 26 May '06  
You only know English; poor guy.Laugh

- It's easier to make than to correct a mistake.


Last Updated 25 May 2006 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010