compiler-construction - llvm-c/Types.h:没有这样的文件或目录
问题描述
我正在为 C 的一个子集编写一个玩具编译器。我正在为 AST 使用 flex、bison 和 LLVM。为了生成 AST,我编写了一个包含节点定义和继承细节的头文件。标题如下:
#include <iostream>
#include <vector>
#include <llvm-6.0/llvm/IR/Value.h>
....
使用以下命令序列编译我的文件后:
bison -d parser.y -o parser.cpp
flex -o tokens.cpp tokens.l
g++ -o parser parser.cpp tokens.cpp main.cpp
然后编译器抛出以下错误:
In file included from node.h:3:0,
from parser.y:2:
/usr/include/llvm-6.0/llvm/IR/Value.h:17:10: fatal error: llvm-c/Types.h: No such file or directory
#include "llvm-c/Types.h"
^~~~~~~~~~~~~~~~
compilation terminated.
In file included from node.h:3:0,
from tokens.l:3:
/usr/include/llvm-6.0/llvm/IR/Value.h:17:10: fatal error: llvm-c/Types.h: No such file or directory
#include "llvm-c/Types.h"
^~~~~~~~~~~~~~~~
compilation terminated.
In file included from node.h:3:0,
from main.cpp:2:
/usr/include/llvm-6.0/llvm/IR/Value.h:17:10: fatal error: llvm-c/Types.h: No such file or directory
#include "llvm-c/Types.h"
^~~~~~~~~~~~~~~~
compilation terminated.
我尝试搜索“include”目录,“Types.h”文件在其他地方,而不是在“llvm/IR”目录中。在编译期间应该包括任何路径吗?任何帮助表示赞赏!
解决方案
推荐阅读
- java - 使用 ConfigurationProperties 自动装配抽象配置
- python - 如何使用python对一个命令行程序一一执行多个命令?
- excel - 如何基于固定时间间隔获取庞大数据库的价值
- windows - 如何在 Virtualbox (Ubuntu) 中运行 Docker 并在 Win10 主机上使用它
- gitlab - 在多项目git管道中传递变量
- javascript - 如何在赛普拉斯测试运行之前清除文件的数据
- azure-aks - 在 App G/w Ingress Controller 中将覆盖后端路径设置为空字符串
- apache-flink - Flink Table-API 和 DataStream ProcessFunction
- reactjs - TailwindCSS 动画不适用于深色变体
- python - Azure函数(python)将输出写入动态命名的输出blob路径