How to install clang header files?

I have clang installed on my MacOS (in /usr/bin/clang ) which I think comes installed by default on Mac, however, when I try to include clang header files in a script, it says they are not found

Example.cpp:1:10: fatal error: 'clang/Driver/Options.h' file not found

Question: is it necessary (and possible, if so, how) to install the header files when clang is already installed and built on the MacOS system (or does clang itself need to be reinstalled at the same time as all the desired development tooling packages and their header files are installed)?

#include "clang/Driver/Options.h"
#include "clang/AST/AST.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Frontend/ASTConsumers.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Tooling.h"
#include "clang/Rewrite/Core/Rewriter.h"

当您使用双引号来包含库时,它将搜索c / cpp文件或应用程序所在的当前目录。尝试使用<>或使用-I选项编译


The question asked if it was necessary and possible to install the header files on MacOS which comes with clang installed already. The desired header files weren't installed and in order to install them it is possible to clone the repo and build llvm and clang (as described in the llvm getting started guide http://llvm.org/docs/GettingStarted.html) , so that it's in effect installed twice on the system.

链接地址: http://www.djcxy.com/p/96038.html

上一篇: ReLU可以处理负面的输入吗?

下一篇: 如何安装clang头文件?