K
KIRAN
Hello all,
My question is about the way of including header files(*.h) in source
files (*.c)
I have three folders,
-build ( for project makefiles)
-include ( for *.h files)
-src (for *.c files).
I know that there are two ways of specifying include path of header
files
1. using -I flag at the compilation ( for gcc)
2. including *.h files in source file with complete relative path
(Ex. to include test.h in test.c I would write #include "../include/
test.h" in test.c)
Which is the most preferred method of the above two?
Suggestions/help is apprecited. Thanks in advance.
Regards,
Kiran
My question is about the way of including header files(*.h) in source
files (*.c)
I have three folders,
-build ( for project makefiles)
-include ( for *.h files)
-src (for *.c files).
I know that there are two ways of specifying include path of header
files
1. using -I flag at the compilation ( for gcc)
2. including *.h files in source file with complete relative path
(Ex. to include test.h in test.c I would write #include "../include/
test.h" in test.c)
Which is the most preferred method of the above two?
Suggestions/help is apprecited. Thanks in advance.
Regards,
Kiran