1

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.

2
  • You could try export INCLUDE_PATH=$INCLUDE_PATH:/your/dir. Not sure whether gcc really uses INCLUDE_PATH, though. Commented Jul 12, 2012 at 15:33
  • Modified gcc-specs come to mind ... Commented Jul 12, 2012 at 15:50

2 Answers 2

1

-nostdinc -I/first/include ... -I/last/include (note that you will need the normal include also)

Sign up to request clarification or add additional context in comments.

Comments

0

Gcc has a -idirafter flag that will add the include directory to the last searched directory (after every directory specified with -I)

Comments

Your Answer

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.

Ask question

Explore related questions

See similar questions with these tags.