Most Read Latest News Blog Resources

Tips: Taking C++ on its Maiden Voyage




November 7, 2007 — 
Last time I explained how to get up and running with the CDT, the C/C++ Development Tooling project. I covered how to install the tools along with a gcc compiler, a required component for building your C++ applications. This week, I'll look at some of the CDT's interesting features.

Starting Eclipse with the CDT is no different than with any other plugin. If opening for the first time, Eclipse will show you the welcome screen and put you into the C/C++ perspective by default, as shown in Figure 1.

If you're used to the Java perspective, you'll notice a difference in the Make Targets View, which enables you to select the make targets you want to build in your workspace. Another difference is the Project Explorer view, which provides a hierarchical view of the resources in the Workbench. From this view, you create your C/C++ project and files for editing or select resources for operations such as exporting.

Starting with the Project Explorer and the corresponding File->New menu, you're presented with the list of options as shown in Figure 2.

As always, you can create general projects, folders and files. As the figure shows, you can also create the corresponding items related to C/C++ development such as header, source and class files. Selecting the C++ option and hitting the Next button brings the wizard to a page where you can create C++ projects containing entities such as executables, shared libraries, static libraries and makefiles, as shown in Figure 3.

Here is the first place that you can also check to see if your installation of a gcc compiler was successful. In my case, I installed one for the Mac OS. If you installed more than one compiler, you can select which one your project should use from this page in the wizard.

From this page, you can also select a template to start your project. I selected the Hello World C++ Project template. Hitting the Next button brings you to a page where you enter information specific to the template you selected, as shown in Figure 4.

Hitting the Next button again brings you to a page where you can select the different configurations you're interested in, such as debug and release, as shown in Figure 5.

Finally, selecting the Finish button produces your project as shown in Figure 6, complete with binaries, includes, src and debug files.

You can do more implementation if you need to, but the application is now ready to run. Select the project and the Run button, and you'll be asked if you want to run your project as a Local C/C++ application.

Next, you're prompted to select which debugger your project uses, as shown in Figure 7, and then it runs.

The corresponding menu entries for building, cleaning and making targets are available under Eclipse's Project menu, as with the Java Tooling. In addition, the search functionality has been extended to include C/C++ specific data, as shown in Figure 8.

Now comes the really cool part. The debugger works pretty much the same as it did with the Java Tooling, as shown in Figure 9.

You set breakpoints the same way. You start the debug session the same way. There is a Debug perspective that looks much the same. And you step and navigate much the same as in the Java Tooling. Works for me! When exploring and learning a new tool, I find it easiest when access to features is consistent from one tool to another. I hate having to remember different ways to do the same things!

If you're experienced with Java Tooling, the move to CDT should be just a quick little jump.

WAS THIS TIP HELPFUL?


Share this link: http://www.sdtimes.com/link/31282
 

Add comment


Name*
Email*  
Country     


  • Comment
  • Preview
Loading



 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 
Download Current Issue
ISSUE 3/15/2010 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
blogs tab
Google Code turns 5
Google Code Turns 5, and adds a Paxos Algorithm to make the system more stable and reliable.
03/17/2010 11:16 AM EST

Test your Visual Studio 2010 know-how
Microsoft is offering free beta certification exams for Visual Studio 2010.
03/17/2010 11:08 AM EST

Microsoft lifts the hood on IE9
Microsoft is previewing IE9.
03/16/2010 01:10 PM EST

 

Events calendar tab
3/22/2010 to 3/25/2010
Santa Clara, Calif.
The Eclipse Foundation

4/12/2010 to 4/14/2010
Las Vegas
Penton Media

4/12/2010 to 4/15/2010
Santa Clara, Calif.
O'Reilly Media

4/19/2010
New York City
Flagg Management

4/25/2010 to 4/28/2010
Overland Park, Kans.
IIUG