This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 202377 - get include search paths from gcc
Summary: get include search paths from gcc
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 7.0.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 19:15 UTC by igagis
Modified: 2011-09-21 09:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description igagis 2011-09-20 19:15:12 UTC
I have Ubuntu system and gcc/g++-4.5.2 installed. And netbeans IDE c++ code assistance reports that it can't find some include files and underlines corresponding #include directives with red wave line. For example it could not find the stddef.h which is in /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include on my system. I assume CND's code assistance does not use this search path by default.

Need to get default include search paths from the output of the following command:

$ echo "" | g++ - -v -E

here is the excerpt from the command output:
...
#include <...> search starts here:
 /usr/local/include
 /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include
 /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include-fixed
 /usr/include/i386-linux-gnu
 /usr/include
End of search list.
...
Comment 1 Vladimir Voskresensky 2011-09-20 19:44:06 UTC
We do get include paths and predefined macros from compiler.
What is your NB version?
Can you check Tools->Options->C++->Code Assistance?
Comment 2 igagis 2011-09-20 20:16:15 UTC
NB version is 7.0.1.

I checked Tools->Options->C++->Code Assistance and it looks like all paths are there, but these paths are from g++-4.4.

It appeared that I have both packages installed g++-4.4 and g++-4.5 and g++ is symlinked to g++-4.5.

I had Netbeans 6.9 installed some time ago, probably when I was using g++-4.4, later I upgraded to g++-4.5.
Today I installed NB 7.0.1 and it imported settings from my old NB installation,
and looks like it did not update paths to g++-4.5's ones.

In the Build Tools I used the Restore Defaults button and it rescanned the system and updated the paths.

But, it still can't find that stddef.h. I created a new "C++ Application" project and it generated main.cpp which includes the <cstdlib> and it is underlined with yellow line, opening the file it leads to include of <stddef.h> which is underlined with red.
But, if including that stddef.h directly to main.cpp it works ok and the file can be found.
Comment 3 Vladimir Voskresensky 2011-09-20 20:23:04 UTC
Go to Tools->Options->C++->Build Tools and press "Restore Defaults" button.
Then close Options and in project context menu try Code Assistance->Reparse Project

can you try to run NB:
- with clean userdir (i.e. start nb with option --userdir /path/to/folder) 
- and without importing options from old NB instance?
Does it work?
Comment 4 igagis 2011-09-20 20:40:20 UTC
Ok, now it works.

Just Reparsing the project did not help. I had to turn Code assistance off and the turn it on again and only then reparse the project.

Thanks for help! Close the bug as invalid please.