1752292 Members
4594 Online
108786 Solutions
New Discussion юеВ

Including header files

 
SOLVED
Go to solution
ram_47
Frequent Advisor

Including header files

Am using a header(.h) file for storing user defined structures and the same file is being included in the source(.C) file. When i compile i see a message - cannot find file specified in the #include directive.

Not sure why it is saying so. The (.h) and the (.c) files are in the same directory.
5 REPLIES 5
Kris Clippeleyr
Honored Contributor
Solution

Re: Including header files

Ram,

Use the quoted form of the #include, like

#include "my_header.h"

Please, also read the information given by

HELP CC /INCLUDE

and

HELP CC LANG PREPROCESSOR #include

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Daniel Fernandez Illan
Trusted Contributor

Re: Including header files

Ram
You can also modify DECC$SYSTEM_INCLUDE logical name to point to directory when my_header.h is located.
Saludos.
Daniel.
Bojan Nemec
Honored Contributor

Re: Including header files

ram,

Only header files in quotes ("my_header.h") are included when they are in the same directory. Angle brackets () are for system includes. You can change the behavior with /INCLUDE_DIRECTORY and /NESTED_INCLUDE_DIRECTORY qualifiers and the logical names (DECC$USER_INCLUDE, DECC$SYSTEM_INCLUDE, DECC$LIBRARY_INCLUDE).

Please see $ HELP CC /INCLUDE_DIRECTORY and $ HELP CC /NESTED_INCLUDE_DIRECTORY for detailed instructions.

Bojan
Antoniov.
Honored Contributor

Re: Including header files

Ram,
look at my example your thread about example.
I use double quote for my header and I define DECC$USER_INCLUDE logical name.

Antonio Vigliotti
Antonio Maria Vigliotti
ram_47
Frequent Advisor

Re: Including header files

Thanks for your replies. It has helped.