Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Solving indexer unresolved typedefs
Solving indexer unresolved typedefs [message #1807416] Wed, 29 May 2019 12:30 Go to next message
Pedro Batista is currently offline Pedro BatistaFriend
Messages: 2
Registered: May 2019
Junior Member
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 12:49]

Report message to a moderator

Re: Solving indexer unresolved typedefs [message #1807420 is a reply to message #1807416] Wed, 29 May 2019 14:50 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
#include <types.h> means a header in the system,
#include "types.h" means a header in your directories.

Have you tried using quotes?


--

Tauno Voipio
Re: Solving indexer unresolved typedefs [message #1807443 is a reply to message #1807420] Thu, 30 May 2019 09:08 Go to previous messageGo to next message
Pedro Batista is currently offline Pedro BatistaFriend
Messages: 2
Registered: May 2019
Junior Member
Yes, the result is the same
Re: Solving indexer unresolved typedefs [message #1807489 is a reply to message #1807443] Fri, 31 May 2019 06:12 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
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: Fri Apr 26 14:55:13 GMT 2024

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

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

Back to the top