llvm - 如何使用 llvm::cl::ParseCommandLineOptions> - 链接错误
问题描述
我正在尝试使用 llvm::cl 来解析命令行参数。首先,我正在尝试编写一个简单的驱动程序,通过 llvm::cl::ParseCommandLineOptions 从命令行解析输入文件。
#include "llvm/Support/CommandLine.h"
int main(int argc, char *argv[]) {
llvm::cl::ParseCommandLineOptions(argc, argv, "quad2bitcode generator\n");
llvm::cl::opt<std::string> InputFilename(llvm::cl::Positional,
llvm::cl::desc("<input file>"),
llvm::cl::Required);
...
编译时,我收到以下链接错误。任何帮助将不胜感激!
Undefined symbols for architecture x86_64:
"__ZTIN4llvm2cl18GenericOptionValueE", referenced from:
__ZTIN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE in quadreader.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
解决方案
推荐阅读
- python - Selenium 除了启动浏览器并打开页面外无法正常工作
- javascript - 如何从 React 项目的 API URL 中删除冒号 (:)
- javascript - 从他的父母那里获取元素的索引
- python - 如何让 PyCharm 从由 PyScaffold 创建的 setup.cfg 中获取测试配置?
- java - IntelliJ:逐步调试新的 HashSet():字段在没有看到的情况下被初始化
- windev - HyperFile如何休息密码
- kubernetes - Kubernetes HPA 节点删除宽限期
- python - 使用子进程获取 pv 输出
- java - Spring Security 禁用方法安全性
- asp.net-core - Aspnetcore Bearer auth:在中间件内部使用用户