Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

(Eclipse) How to add directories to GCC include path

Hi,

I'm trying to bring some existing code into a program that relies on the GCC compiler finding include files in other project include directories

For example x/x.c says:

# include "myinclude.h"

To include the file include_dir/myinclude.h

When I bring the code into eclipse it initially reports "unresolved inclusion: myinclude.h" at the line where the file is included - which is completely reasonable as I haven't told eclipse where to find myinclude.h.

Then I went into the project properties to c/c++ general --> paths and symbols ->includes and added include_dir (export, for all languages, workspace directory).

This resolves the 'unresolved inclusion' message but when I try to build the code the include file isn't found by the compiler. Looking at the compiler command line there is no '-I' option on the compiler command line to tell the compiler about the directories I added.

Any suggestions on how to get the GCC to look in additional directories for its include files?

Thanks,

Darren.

14 Replies