Skip to content

clang_arg don't work when used to include the header file #2418

Closed Answered by pvdrz
try-agaaain asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah that's expected. The issue is that -include actually includes the file you pass to it instead of just telling C that the file is available somewhere. Basically doing -include long_path is the same as putting #include "long_path" at the top of your headers. When you do -I long_path this tells the compiler that long_path is one of the directories where it should search for headers.

So you have two options:

  • Remove the #include from your headers and pass -include.
  • Just use -I with the directory.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@try-agaaain
Comment options

@pvdrz
Comment options

Answer selected by pvdrz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2414 on February 16, 2023 16:12.