Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] The Indexer only wants to use the default system headers

Dear Dmitry,

Thanks for your response, I managed to get it working! Having somebody like you as backup really helps.

FYI. The problem was not that the directories didn't show up at "Paths and Symbols", but that they seem to be in the wrong order. So, the problem is not that the indexer doesn't find them, but that it first finds the system files and hence redirects to the wrong files. Now, I manually added the directories again, so they appear on top of the list over there, I used the "Full Indexer" and included also files that weren't built or included (first option). And now <string.h> goes indeed to the appropriate file.

I think it might be considered a small bug that even though my $PATH environmental variable starts with the custom "/opt/arm-2008q1/arm-none-eabi/include" directory, the Indexer first searches in the "/usr/include" directory. Am I correct that this might be considered a bug? Or is this bug solved in a later version (I use Eclipse 3.2.2)?

Kind regards,


On 27/11/2008, Dmitry Smirnov <divis1969@xxxxxxxxx> wrote:
Try to add /opt/arm-2008q1/arm-none-eabi/include to the list of
include directories of your project (Properties->C++ General->Paths
and Symbols) and rebuild the index.
Also, you can try to use Properties->C++ Build->Discovery
Options->Discovery Profile options->Load Build output from file.
Using it, you can use the build log to be parsed and all the include
paths and symbols to be added to the project automatically.

2008/11/26 Anne van Rossum <anne@xxxxxxxxxxx>:

> Dear all,
> Within Eclipse I encountered the problem that "Open Declaration" (F3) may
> take you to the wrong file. In my case I followed "malloc.h" and saw that
> there were __malloc_hook definitions. So, I added code that rerouted all my
> calls to malloc to an allocation function for FreeRTOS (an OS for
> microcontrollers). However, it turned out that I had been looking at the
> wrong "malloc.h" file! Apparently the Indexer in Eclipse returns the
> /usr/include/malloc.h file while it should have returned the
> /opt/arm-2008q1/arm-none-eabi/include/malloc.h file (of my arm-none-eabi
> cross-compiler).
> To make myself very clear: Compiling everything works okay! However, the
> indexer doesn't work.
> Changing the "Compiler Invocation Command" at Project Properties to
> /opt/arm-2008q1/bin/arm-none-eabi-gcc or by running it from the console by:
> arm-none-eabi-gcc -E -P -v -dD
> $MYPROJECT/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c doesn't work
> at all. By the way, the $PATH is neither recognized w.r.t. the Indexer. Just
> writing arm-none-eabi-gcc leads to the following error:
> Error launching external scanner info generator (arm-none-eabi-gcc -E -P -v
> -dD $MYPROJECT/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c)
> Error launching external scanner info generator (arm-none-eabi-g++ -E -P -v
> -dD $MYPROJECT/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp)
> Each time I rebuild all files and I refresh all files in the "right mouse
> click popupmenu" - indexer. But each time F3 (Open Declaration) takes me to
> the wrong file... :-(
> And... it doesn't help if I set nostdinc or nostdinc++ on the Compiler
> Invocation Command. In contrary, now, the same error as above is generated.
> Can anybody help me out? Did anybody made CDT/Eclipse work properly in
> directing to the right index files on F3?
> I used the Fast C/C++ Indexer and I enabled the setting "Index all files
> (files neither built nor included, also).
> Kind regards,
> Anne

Back to the top