Eclipse How-To

The following gives an extremely cursory overview for getting a C++ project started in Eclipse on Linux. You'll find much more comprehensive material elsewhere, such as in the tutorial at http://www.ibm.com/developerworks/opensource/library/os-eclipse-stlcdt/
See also instructions for compiling on other platforms.






    • If you're writing an OpenGL program on Linux, make sure that "GL" and "glut" have been added.


Importing a Project into Eclipse

  • After starting up Eclipse, select File->Import and select "General -> Existing Projects into Workspace", e.g.:



  • Click next when you're done.  In the new dialog, you'll be able to specify the location of your project directory via the "Select root directory" field.  After doing so, click "Finish" to get to the actual project viewer.

Debugging in Eclipse


  • To debug your executable in Eclipse go to "Run->Debug As->Local C++ Application."  If it's your first time debugging, you'll be prompted by a dialog window and asked to choose a Launcher.  Check the "Use configuration specific settings" and select the first launcher "GDB (DSF) Create Process Launcher," e.g.:



  • Click OK to continue.
  • Eclipse will ask you if you want to open up the "debug" perspective.  Clicking yes will take you to a window panel similar to the following:



  • The most interesting information is shown via the top two panels.  The top-left shows the current stacktrace of the running program, and provides buttons for continuing, terminating, and stepping through the code.  The top-right panel shows variables and their contents for the current frame.