Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Preprocessor inclusion not found
Preprocessor inclusion not found [message #158762] Tue, 22 November 2005 11:53 Go to next message
Eclipse UserFriend
Originally posted by: eh.dataconnection.com

Newbie question, I'm afraid.

I have existing source that I'm trying to import into a CDT project on
Linux. My source is organised along the lines of:

<top-leveldir>/code/<X>/codemods/<Y>
<top-leveldir>/build/<Z>/

...where
<X> has a few values
<Y> is all the actual code
<Z> takes values for all the executables and libraries we build, and contains
the .o files.

First off, I've created a standard make project, and used <top-leveldir>
as the location for the Project Contents. The first problem I hit is that
it goes away and indexes the code, but gives me a lot of inclusion not
found errors, even though the included files are present below
<top-leveldir>.

Is there something else I need to do here, to get the indexer to recognise
all the source in all the subdirectories below <top-leveldir>?
Re: Preprocessor inclusion not found [message #158767 is a reply to message #158762] Tue, 22 November 2005 12:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eh.dataconnection.com

Judging by the posts, this seems to be a common problem, doesn't it? But
I haven't found the common answer.
Re: Preprocessor inclusion not found [message #158781 is a reply to message #158762] Tue, 22 November 2005 20:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.dharty.com

Something that worked for me was to "Internal" paths as "External"
include paths relative to the project. Adding "Include Paths from
Workspace" could never find the included directory, especially if I used
linked folders.

Project->Properties->C/C++ Include Paths
"Add External Include Path"
./code
./code/codemods/

D


Edward Hibbert wrote:
> Newbie question, I'm afraid.
>
> I have existing source that I'm trying to import into a CDT project on
> Linux. My source is organised along the lines of:
>
> <top-leveldir>/code/<X>/codemods/<Y>
> <top-leveldir>/build/<Z>/
>
> ..where <X> has a few values
> <Y> is all the actual code
> <Z> takes values for all the executables and libraries we build, and
> contains the .o files.
>
> First off, I've created a standard make project, and used <top-leveldir>
> as the location for the Project Contents. The first problem I hit is
> that it goes away and indexes the code, but gives me a lot of inclusion
> not found errors, even though the included files are present below
> <top-leveldir>.
> Is there something else I need to do here, to get the indexer to
> recognise all the source in all the subdirectories below <top-leveldir>?
>
Re: Preprocessor inclusion not found [message #158833 is a reply to message #158781] Wed, 23 November 2005 08:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eh.dataconnection.com

Excellent, that does the trick. Thanks.
Re: Preprocessor inclusion not found [message #159310 is a reply to message #158781] Tue, 29 November 2005 04:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: void.void.com

David H wrote:
> Something that worked for me was to "Internal" paths as "External"
> include paths relative to the project. Adding "Include Paths from
> Workspace" could never find the included directory, especially if I used
> linked folders.
>
> Project->Properties->C/C++ Include Paths
> "Add External Include Path"
> ./code
> ./code/codemods/
>

Hm, I can't find anything called "C/C++ Include paths" in the project
properties pane. Is this because I started a managed make project?

My problem is similar to that of the OP:
The Indexer doesn't recognize any includes of the form <abc/xyz.h> and
prints tons of warning that it can't find these files (although the
program compiles fine). I guess it's a bug in the indexer, but very
annoying because half of my includes are underlined with a warning.

Any help appreciated.

Regards,
Matthias
Re: Preprocessor inclusion not found [message #159317 is a reply to message #159310] Tue, 29 November 2005 06:19 Go to previous messageGo to next message
Eclipse UserFriend
Matthias Kaeppler wrote:

> Hm, I can't find anything called "C/C++ Include paths" in the project
> properties pane. Is this because I started a managed make project?

When using managed make, you should have a property page "C/C++ Build" for
the project.

Activate the tab "Tool Settings", under "GCC C++ Compiler" there should be
an entry for "Directories". There you can add any missing include paths.
(Assuming that you are using GCC.)

HTH, Markus
Re: Preprocessor inclusion not found [message #159350 is a reply to message #159317] Tue, 29 November 2005 14:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: void.void.com

Markus Schöpflin wrote:
> When using managed make, you should have a property page "C/C++ Build"
> for the project.
>
> Activate the tab "Tool Settings", under "GCC C++ Compiler" there should
> be an entry for "Directories". There you can add any missing include
> paths. (Assuming that you are using GCC.)

But does the Indexer refer to these settings? I mean, my program
compiles, it's just the Indexer which keeps complaining. If it's only
for the compiler, then I don't need to set them manually because I am
passing the directories in question to the compiler/linker using
pkg-config already.

Regards,
Matthias
Re: Preprocessor inclusion not found [message #159396 is a reply to message #159350] Wed, 30 November 2005 03:54 Go to previous messageGo to next message
Eclipse UserFriend
Matthias Kaeppler wrote:

> Markus Schöpflin wrote:
>
>> When using managed make, you should have a property page "C/C++ Build"
>> for the project.
>>
>> Activate the tab "Tool Settings", under "GCC C++ Compiler" there
>> should be an entry for "Directories". There you can add any missing
>> include paths. (Assuming that you are using GCC.)
>
>
> But does the Indexer refer to these settings? I mean, my program
> compiles, it's just the Indexer which keeps complaining. If it's only
> for the compiler, then I don't need to set them manually because I am
> passing the directories in question to the compiler/linker using
> pkg-config already.

For me, yes it does. I tested it with the following little example:

---%<---
#include <boost/shared_ptr.hpp>

int main()
{
boost::shared_ptr<int> p;
return 0;
}
--->%---

I can right click on "shared_ptr" in line 5 and select "Open Declaration"
and it opens "shared_ptr.hpp" and highlights the declaration of the
shared_ptr class.

Markus
Re: Preprocessor inclusion not found [message #159467 is a reply to message #159396] Wed, 30 November 2005 11:20 Go to previous message
Eclipse UserFriend
Originally posted by: void.void.com

Markus Schöpflin wrote:
> For me, yes it does. I tested it with the following little example:
> <snip>

Sweet, you're right, thanks.

I checked BugZilla and it looks as if the bug has been reported several
times already, so I guess we'll just have to hope it'll be fixed with
the next release.

Best regards,
Matthias Kaeppler
Previous Topic:Application does not launch if I have an error reported
Next Topic:C++ under Windows XP
Goto Forum:
  


Current Time: Sun May 11 11:40:34 EDT 2025

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

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

Back to the top