include paths

I am attempting to build a C project using a makefile. I have a sub-folder
in the project folder which contains include files, and I have this folder
added to the project include paths. However, the compiler seems to be
unable to find the include files. Specifically, I have main.c with the line

#include <define.h>

where main.c is in the project folder /test, and define.h is in /test/add.
Do I need to also add the include paths explicitly in the makefile in
addition to right-clicking on the project folder and selecting Add Project
Include Paths… or something else?

Don

#include <foo.h> searches for foo.h in the system include path.
#include “foo.h” searches for foo.h in the user path.
I’m not sure what this might mean for your Momentics settings.

Marty Doane
Siemens L&A

“Don Tucker” <dtucker@arlut.utexas.edu> wrote in message
news:d7i11d$dqb$1@inn.qnx.com

I am attempting to build a C project using a makefile. I have a
sub-folder
in the project folder which contains include files, and I have this folder
added to the project include paths. However, the compiler seems to be
unable to find the include files. Specifically, I have main.c with the
line

#include <define.h

where main.c is in the project folder /test, and define.h is in /test/add.
Do I need to also add the include paths explicitly in the makefile in
addition to right-clicking on the project folder and selecting Add Project
Include Paths… or something else?

Don

Don Tucker <dtucker@arlut.utexas.edu> wrote:

I am attempting to build a C project using a makefile. I have a sub-folder
in the project folder which contains include files, and I have this folder
added to the project include paths. However, the compiler seems to be
unable to find the include files. Specifically, I have main.c with the line

#include <define.h

where main.c is in the project folder /test, and define.h is in /test/add.
Do I need to also add the include paths explicitly in the makefile in
addition to right-clicking on the project folder and selecting Add Project
Include Paths… or something else?

Is this a QNX C project, or a Standard Make project?

If it is a Standard Make project, you will need a -I directive for
the compilation of the source files that need the header specifying
where to find the source.

If it is a QNX C project, you will need to right-click on the project,
select Properties. Then click on QNX C/C++ Project, click on Compiler,
slelect “Extra include paths” in the “Category” drop-down list at the
top, and then under “Add From” click either “Project” or “Disk” and
specify the directory. (I think both work.)

What I THINK you have set is the bit that tells the IDE’s code parser/header
file opener tool how to find the header files, not the bit that tells the
build side of things how to find header files.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

The project build cannot find the include file whether I use < > or " ".

Don

“Marty Doane” <martin.doane@siemens.com> wrote in message
news:d7i42d$g37$1@inn.qnx.com

#include <foo.h> searches for foo.h in the system include path.
#include “foo.h” searches for foo.h in the user path.
I’m not sure what this might mean for your Momentics settings.

Marty Doane
Siemens L&A

“Don Tucker” <> dtucker@arlut.utexas.edu> > wrote in message
news:d7i11d$dqb$> 1@inn.qnx.com> …
I am attempting to build a C project using a makefile. I have a
sub-folder
in the project folder which contains include files, and I have this
folder
added to the project include paths. However, the compiler seems to be
unable to find the include files. Specifically, I have main.c with the
line

#include <define.h

where main.c is in the project folder /test, and define.h is in
/test/add.
Do I need to also add the include paths explicitly in the makefile in
addition to right-clicking on the project folder and selecting Add
Project
Include Paths… or something else?

Don
\