Reputation: 142
I'm using c. And I have a include
folder inside my project myProject/include
and inside I have all the header files from the SDK I downloaded from the Internet. So my question is how can I tell the gcc
to look for the header files inside the include folder?
Upvotes: 1
Views: 2042
Reputation: 134326
You can use the -I
option with gcc
to tell the path where to look for the header files.
From online gcc manual
-Idir
Add the directorydir
to the head of the list of directories to be searched for header files. This can be used to override a system header file, substituting your own version, since these directories are searched before the system header file directories. [...]
You can use this option multiple times,
[...] If you use more than one
-I
option, the directories are scanned in left-to-right order; the standard system directories come after.
Upvotes: 4