Help setting CDT Indexer include path programmaticallyhttps://www.eclipse.org/forums/index.php/mv/msg/310469/821762/#msg_821762
I am new to developing using CDT plug-in. I am currently using Eclipse Indigo to develop my plug-in. I was planning on making use of the features automatically available with CDT - content assist, error reporting, etc. But CDT always reports syntax errors - "Type '<Variable>' could not be resolved" and annotates the source for all definitions and variables unless they are defined in the same source file. This makes code readability very difficult. The project build successfully as it has its own build files where the Include path is correctly referenced..

I presume that this is due to the CDT indexer not having all the include paths available to it. I want to know how I can provide CDT with the include paths programmatically. It is not possible to provide the include paths via preferences as there are a lot of modules and they change across projects.

I looked online for a way to programmatically set the include path but I was not able to find any help or instructions. Any help with this will be appreciated.

With Regards,

Presanna Raman.

P.S. I have attached image of what I see in the editor. Note: The INT32 macro is resolved while the rest are not.]]>Presanna Raman2012-03-15T19:46:58-00:00Re: Help setting CDT Indexer include path programmaticallyhttps://www.eclipse.org/forums/index.php/mv/msg/310469/821830/#msg_821830

What I am doing wrong? I tried to find what each of these classes mean but I am having difficulty finding helpful documentation.

With Regards,

Presanna Raman.]]>Presanna Raman2012-03-15T21:46:33-00:00Re: Help setting CDT Indexer include path programmaticallyhttps://www.eclipse.org/forums/index.php/mv/msg/310469/829510/#msg_829510
I have a similar issue with my plugin.
After a search in the CDT sources I found something that is working for me in:
Project: org.eclipse.cdt.ui
Class: org.eclipse.cdt.internal.ui.wizards.settingswizards#readSettings()

]]>Slavian Petrov2012-03-26T11:41:32-00:00Re: Help setting CDT Indexer include path programmaticallyhttps://www.eclipse.org/forums/index.php/mv/msg/310469/941103/#msg_941103
But the C/C++Build->Paths&Symbols does not update with the new data.

When access the data using setting.getsettingEntries() I can see the newly added data. But can't see in the properties window or
in project explorer.]]>TBT Andrew2012-10-12T08:10:55-00:00Re: Help setting CDT Indexer include path programmaticallyhttps://www.eclipse.org/forums/index.php/mv/msg/310469/941287/#msg_941287
I made a mistake in the code above - bad if (...)
This is how I made it finally:
if (!setting.getId().startsWith("cdt.managedbuild.tool.gnu.cpp.compiler"))
continue;]]>Slavian Petrov2012-10-12T11:15:44-00:00Re: Help setting CDT Indexer include path programmaticallyhttps://www.eclipse.org/forums/index.php/mv/msg/310469/1015765/#msg_1015765
I am developing an eclipse plugin. I want to add the include paths programmatically when creating a new project. I am not sure about where to include the piece of code mentioned in the above posts. Could you please let me know the point where should this code be initiated.

Regards,
Krishnaraj.]]>Krishnaraj Bhat2013-03-02T13:13:00-00:00Re: Help setting CDT Indexer include path programmaticallyhttps://www.eclipse.org/forums/index.php/mv/msg/310469/1019112/#msg_1019112
Could you please let me know where should I write the piece of code mentioned by you so that new projects created will include the "INCLUDE PATHS".

In the above the clas s that implements org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser is the key. It basically parses the the output of the scannerInfoProvider (i.e. the command [your gcc path] -E -P -v -dD specs.c).

Here various included files are parsed and added to the project. See the shutDown method for the CDT's default GCCSpecsConsoleParser.java

You can simply detect and add your own include directories here.]]>Aravind Parvathala2014-09-14T08:25:58-00:00Re: Help setting CDT Indexer include path programmaticallyhttps://www.eclipse.org/forums/index.php/mv/msg/310469/1424120/#msg_1424120
https://wiki.eclipse.org/CDT/Developer/FAQ#How_do_I_contribute_Include.2FLibrary_paths_or_Macros_to_a_project_configuration_using_LanguageSettingsProvider_extension_point.3F. This is the preferred way of adding include paths.