A little problem with ANSI C and gcc
Hey guys,
I don't know whats the problem, I'm doing everything by the book (well, at least I think so) I have a file calle "complex.h" Code:
int check_complex(char ch); Code:
#include <stdio.h> Code:
ilia@debianIL:~/c-class/source/mmn/12/q2$ make thnx alot ! |
"complex.h" is a system include file, so, for starters, rename your file into something else.
|
Quote:
I don't recall the exact search rules for include files, but in normal use, one sets up the search rules so that system wide header files are found when you use <> and your own header files are found when you use "". |
ok,
thanks alot ! :) |
To complete johnsfine's explanation:
when you surround your header files with < and > it means that gcc will look into the system headers (/usr/include on GNU/linux), and on any path you provide to him with the -I option when you surround your header files with double quotes, you must provide the complete header relative path in regard to the source file where you're making the #include. |
Quote:
I haven't bothered this time to dig through the doc's, but I know from common usage that include directories can be given on the command line that will apply to #include lines using "". The important difference is that some places it searches for #include <> files automatically (with no command line switch needed) are not searched for #include "" files. The difference between <> and "" should also help anyone reading your code know whether you intended some system header file vs. some header file inside your own project. |
All times are GMT -5. The time now is 09:35 PM. |