Reputation: 359
I've been having quite a few problems migrating from Galileo to Mars version of Eclipse.
I'm currently using a multiple projects, each corresponding to a specific layer of my final product. Each project outputs multiple libraries.
Here is the problem :
1) As pointed in my other question : Eclipse c++ class generation formating, if I add the current project in 'project properties -> C++ General -> Paths and Symbols -> Includes', any auto-generated files comes with angle bracket include preprocessor directive
2) If I remove the above-added include path, the header auto-completion won't work with path relative to the project root dir (both angle bracket and quoted forms). Quoted form with path relative to the current file still works.
As I'm using multiple output lib projects, I need to use angle bracket include style.
Is there any way to fix this probleme ?
Upvotes: 1
Views: 101
Reputation: 359
I finally found out a really easy work-around to my problem :
Use point 1) configuration
Go to 'Window -> Preferences -> C/C++ -> Code Style -> Code Template'
Go to 'Files -> C++ Source File' and edit both test and source template and replace :
${includes}
By:
#include "${file_base}.h"
Upvotes: 0
Reputation: 7970
AFAIK you have hit a limitation in CDT's new class wizard. The Paths and Symbols -> Includes should exactly match what you are doing on the command line so that the indexer works as expected, i.e. provides you the expected completions, etc. Therefore you should have the project root listed as an include directory for the indexer.
That means that the class wizard in your case will always use <> for your includes based on the logic within that code. Unfortunately I don't think there is anything within the current code base of CDT that you can do to resolve your two issues simultaneously. I would guess that the cost of having the class wizard work as you want is outweighed by the loss of the indexer working perfectly.
If the value of having the wizard do the right thing in your case is high enough, I recommend fixing it. A "simple" change to NewClassCodeGenerator.getHeaderIncludeString() should do the trick.
Upvotes: 1