This is a blog of Eclipse enthusiasts from Poznań (Poland) who would like to share their knowledge of Eclipse. We work for the IBM Support Center for Eclipse at Poznań University of Technology.

Wednesday, April 9, 2008

Don't underestimate CDT

If you ask me whether I am C++ or Java programmer I will say Java's one. I used to program C++ a lot and now I am in the situation I will probably do even more. Recently, I've got a code to analyze. So as I am doing most of my programming in Eclipse choice was as usual. The software is pretty big and I tend to be lazy when I can so I decided to import my code to the managed project. Unfortunately, the code conventions are a bit different from common practices (or maybe something has changed since I've switched to Java). Some parts of code are kept in *.cxx files and #included in *.hpp files. Unfortunately with default configuration the code in *.cxx is compiled what evidently leads to compilation errors. What I wanted to do (fortunately that rule is followed in whole project) was excluding *.cxx files from compilation. I started with trying File Types project preferences option, but without results. Then I found working solution. After setting everything up switch off automatic makefiles. Several minutes ago I was thinking that this is the only solution. But don't ever underestimate tools you don't know well. Obviously there is a simple and elegant solution. Project preferences ->C/C++ General -> Paths and symbols -> Source locations tab. You can even make indexworking on excluded files. That made my day :)