Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Including the directory with -I command-line option in gcc appends the directory to the head of include directories.I want to add a directory to be searched after the system include directory.Is there any way to do this in gcc.
export INCLUDE_PATH=$INCLUDE_PATH:/your/dir
INCLUDE_PATH
-nostdinc -I/first/include ... -I/last/include (note that you will need the normal include also)
Add a comment
Gcc has a -idirafter flag that will add the include directory to the last searched directory (after every directory specified with -I)
-idirafter
-I
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
export INCLUDE_PATH=$INCLUDE_PATH:/your/dir. Not sure whether gcc really usesINCLUDE_PATH, though.