Include path not working ?

Topics for the Eclipse Environment
Post Reply
fd9750
Posts: 40
Joined: Fri Mar 29, 2013 8:08 am
Location: Belgium

Include path not working ?

Post by fd9750 »

Hi,

I am fairly new to Eclipse so I may be posing a question with a very simple solution (at least I hope so).

I have this common header file I would like to use for multiple projects.
My NBEclipse is installed under D:\CovanData\NBurn while my workspace is under D:\CovanData\Netburner, the various projects are in subdirectories within that workspace.

I have made a folder called D:\CovanData\Netburner\Common\include where I have located my common header file.
I have added the extra path to that directory to the "Includes" list just like you would do for, for example, "D:\CovanData\NBurn\include"

Sure enough: when you then look at the list of "Includes" you can see all the usual include directories associated with the Netburner installation and the new include path I have added.
Just like the usual ones you can click on the new directory/include path and it shows all of the file contents (1 file for now). Click on the file and you see and/or edit it. (see attached screenshot).

What does not work is compiling the project: I get an error message saying it can't find the file referenced to as:

Code: Select all

#include <BinDefs.h>
I thought the purpose of the include path was to tell the compiler's preprocessor where to look for header files.

Anyone with any ideas as to what I am overlooking ?
Attachments
Capture.PNG
Capture.PNG (213.65 KiB) Viewed 3297 times
fd9750
Posts: 40
Joined: Fri Mar 29, 2013 8:08 am
Location: Belgium

Re: Include path not working ?

Post by fd9750 »

Scratch transmission, I have found it.

Just for clarity: if you add an include path for C Files only it does show up in the "Includes" list but you can't refer to it from within .cpp files. To do that you also need to add the same include path for C++ type files.

Then it shows up once just like before but you can refer to it from both .c and .cpp files.

As usual: simple once you know. ;)
User avatar
tod
Posts: 587
Joined: Sat Apr 26, 2008 8:27 am
Location: Southern California
Contact:

Re: Include path not working ?

Post by tod »

Two more things you may want to know.
  • 1. if you have a run and debug build make sure you select "All Configurations" at the top of the settings dialog when making changes
    2. In the c:\nburn\<moduleName>\ folder you will see a PROPERTIES file with no extension. There is a line that starts with "NBINCLUDE..." you can add include paths here and they will automatically get added to the settings for projects targeting that module.
Post Reply