Thursday, August 2, 2012

Convert legacy of C++ project using Makefile to Eclipse IDE

Suppose you have a legacy of C++ project on Linux which uses the typical:
./configure
make
make install

to build and install.

If you would really like to build it instead with an IDE like Eclipse, how to achieve this?

Using Eclipse with the CDT plugin will allow you to use it for C/C++ projects, and you can tell it to use Makefiles to build your project. You just have to set up a Makefile project. You might have to tell it to let you manage the Makefiles rather than have it do it - I don't remember off the top of my head - but there should be no problem in setting up Eclipse to use pre-existing Makefiles to build a pre-existing project. I've done it before.

You will have to tell it where the include directories are and what macros to assume are defined for things like code completion to work correctly (I don't know of any way for Eclipse to figure that out for you), so there is definitely some set up that you'll have to do. But it definitely works.

Just grab the C++ version of Eclipse from their site (it comes with all of the appropriate C/C++ plugins so that you don't have to track them down), and you can look at the CDT site for documentation, frequently asked questions, etc.

References

http://www.ibm.com/developerworks/aix/library/au-unix-eclipse/index.html
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.cdt.doc.user/getting_started/cdt_w_existing_code.htm

No comments:

Post a Comment