Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Solving indexer unresolved typedefs
Solving indexer unresolved typedefs [message #1807416] Wed, 29 May 2019 08:30 Go to next message
Eclipse UserFriend
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 #1807420 is a reply to message #1807416] Wed, 29 May 2019 10:50 Go to previous messageGo to next message
Eclipse UserFriend
#include <types.h> means a header in the system,
#include "types.h" means a header in your directories.

Have you tried using quotes?
Re: Solving indexer unresolved typedefs [message #1807443 is a reply to message #1807420] Thu, 30 May 2019 05:08 Go to previous messageGo to next message
Eclipse UserFriend
Yes, the result is the same
Re: Solving indexer unresolved typedefs [message #1807489 is a reply to message #1807443] Fri, 31 May 2019 02:12 Go to previous message
Eclipse UserFriend
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




Previous Topic:Stuck stepping code in disassembly only
Next Topic:Trying to make a window
Goto Forum:
  


Current Time: Thu Nov 06 19:22:06 EST 2025

Powered by FUDForum. Page generated in 0.25440 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top