mikroC
making it simple...
mikroC - C Compiler for Microchip PIC microcontrollers
File Inclusion
The preprocessor directive
pulls in header files (extension
) into the
#include
.h
source code. Do not rely on preprocessor to include source files (extension
) —
.c
see Projects for more information.
The syntax of
directive has two formats:
#include
#include < header_name >
#include " header_name "
The preprocessor removes the
line and replaces it with the entire text
#include
of the header file at that point in the source code. The placement of the
#include
can therefore influence the scope and duration of any identifiers in the included
file.
The difference between the two formats lies in the searching algorithm employed
in trying to locate the include file.
If
directive was used with the
version, the search is
< header_name >
#include
made successively in each of the following locations, in this particular order:
1. mikroC installation folder > "include" folder,
2. your custom search paths.
The
version specifies a user-supplied include file; mikroC will
" header_name "
look for the header file in following locations, in this particular order:
1. the project folder (folder which contains the project file
),
.ppc
2. mikroC installation folder > "include" folder,
3. your custom search paths.
Explicit Path
If you place an explicit path in the
, only that directory will be
header_name
searched. For example:
#include "C:\my_files\test.h"
page
130
MikroElektronika: Development tools - Books - Compilers
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?