问题
I am using a shared library , say, shr.so
. This has some header file, say, shr_struct.h
with structures I need to use in my program , say, main_prog.c
.
Do I need to keep a copy of shr_struct.h
in my include path so that I can declare objects of structure types in shr_struct.h
in main_prog.c
?
回答1:
If your main_prog.c
depends on shr_struct.h
, the compiler will need to know where this last file is located.
Now if the library is installed in the system "standard" library path, you may not have to explicitly add this path to the compiler command as it may be smart enough to search in the standard system path by itself.
来源:https://stackoverflow.com/questions/17043228/do-i-need-to-explicitly-include-a-common-header-filein-an-include-path-folder