I know this one way of adding include paths to clang:-
clang++ -I <dir> a.cpp
but with this, that path is only added for that particular file, and u have to write that every time linting, so how can I add some include paths globally to clint.
I know this one way of adding include paths to clang:-
clang++ -I <dir> a.cpp
but with this, that path is only added for that particular file, and u have to write that every time linting, so how can I add some include paths globally to clint.
Copyright © 2021 Jogjafile Inc.
There are also some environment variables which Clang looks at for include paths. For c++, they would be
CPATH(both C and C++) andCPLUS_INCLUDE_PATH(C++ only) (AndLIBRARY_PATHfor the linker). So you can add something like this to your shell startup file if you are using bash or similar:And you could also just alias
clang++withclang++ -I<dir>.