How to use `-isysroot` of clang properly?

Viewed 616

Here's my directory structure:

clang-sysroot
\-sysroot
  \-usr
    \-include
      \-perqin.h
\-test.c

In test.c:

#include <perqin.h>

If I run clang -c test.c -o test.o, the compilation will fail, as the compiler doesn't know where to find perqin.h.

So I try adding isysroot argument:

clang -isysroot "C:\...\clang-sysroot\sysroot" -c test.c -o test.o

But it still fails.

Did I misunderstand the usage of -isysroot? If so, how can I specify the sysroot correctly?

For detailed screenshot:

0 Answers
Related