user26732
user26732

Reputation: 3854

Set include order of directory to last in gcc

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.

Upvotes: 1

Views: 1102

Answers (2)

Raphaël Londeix
Raphaël Londeix

Reputation: 661

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

Upvotes: 0

technosaurus
technosaurus

Reputation: 7802

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

Upvotes: 1

Related Questions