| Solving indexer unresolved typedefs [message #1807416] |
Wed, 29 May 2019 08:30  |
Eclipse User |
|
|
|
Hello
I'm working in a project which uses a lot of typedefs all over the code. Problem is, Eclipse's indexer isn't able able to resolve these types and will underline them as unresolved type errors, even though project compiles just fine.
If the typedefs are defined in the same file as where they are used, Eclipse is able to recognize them, if they are included somewhere in the project, Eclipse will underline them.
EXAMPLE 1:
dummy.cpp:
//-- Eclipse knows what uint8 is.
typedef unsigned char uint8;
uint8 dummy = 0;
EXAMPLE 2:
types.h:
typedef unsigned char uint8;
dummy.cpp:
//-- Eclipse doesn't know what uint8 is, but compiles
#include <types.h>
uint8 dummy = 0;
This is quite bothersome, as it ends up filling eclipse's main view with unresolved type errors which makes it harder to find actual problems.
Building indexer and freshen files will not solve this issue.
Any help?
All the best
[Updated on: Wed, 29 May 2019 08:49] by Moderator
|
|
|
|
|
| Re: Solving indexer unresolved typedefs [message #1807489 is a reply to message #1807443] |
Fri, 31 May 2019 02:12  |
Eclipse User |
|
|
|
Quote:if they are included somewhere in the project, Eclipse will underline them.
Depends on what you mean by "somewhere". If they aren't in the src directory but in, say, inc
then you have to tell Eclipse to use it.
There are a number of ways to do this. The one I use is:
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. --> Entries --> CDT User Setting Entries
and add the directory path.
You need to
1) ensure you have selected the proper build configuration at the top of the dialog
2) do this for each compiler used
Assuming Eclipse is building the make file, you also need to tell the compiler (via the makefile being built by Eclipse) with
Project --> Properties --> C/C++ Build --> Settings --> Tool Settings tab --> <compiler> --> Includes
|
|
|
Powered by
FUDForum. Page generated in 0.04568 seconds