Mac下Clion编译错误:Undefined symbols for architecture x86_64
来源:互联网 发布:mysql月租 编辑:程序博客网 时间:2024/05/17 20:13
在使用CLion做LeetCode题编译时,突然出现了一下的情况:
Undefined symbols for architecture x86_64: "Solution::isCommonPrefix(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, int)", referenced from: Solution::longestCommonPrefix(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&) in main.cpp.old: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)
首先在网上查询错误原因,大概有两点:
1、编译lib没有找到,可能相应的编译环境不正确,缺少某样东西。
2、自己写的代码问题,最有可能的原因就是所用的控制符与系统符号相冲突或者其他情况。
在网上查了一大堆修改编译选项的都没有什么用
最后无奈仔细检查了一下程序,好吧,发现问题了:
有一个函数定义和声明没有严格对应,于是导致编译器在编译的时候产生的符号表无法与实际程序中的函数对应,所以导致了该错误。
所以总结如下:不管怎么说先排查自己的程序到底有没有问题,没有问题在考虑其他!
阅读全文
0 0
- Mac下Clion编译错误:Undefined symbols for architecture x86_64
- mac上使用g++编译出错“Undefined symbols for architecture x86_64:” 错误解决办法
- Mac下C++编译时报错“Undefined symbols for architecture x86_64”
- Xcode 编译 Undefined symbols for architecture x86_64:
- Undefined symbols for architecture x86_64错误
- Undefined symbols for architecture x86_64错误
- Undefined symbols for architecture x86_64:错误
- Xcode错误:Undefined symbols for architecture x86_64
- Undefined symbols for architecture x86_64 错误处理
- BUG-Undefined symbols for architecture x86_64错误
- Undefined symbols for architecture x86_64错误
- Undefined symbols for architecture x86_64:
- Undefined symbols for architecture x86_64
- Undefined symbols for architecture x86_64
- Undefined symbols for architecture x86_64:
- Undefined symbols for architecture x86_64
- Undefined symbols for architecture x86_64
- Undefined symbols for architecture x86_64:
- kRpano 360动态热点添加方式
- 数据重复提交
- CoInitialize和CoUninitialize
- Android实战(橘子娱乐)-首页(第五篇 Glide加载图片的简单封装)
- 服务器虚拟化技术 对比简介
- Mac下Clion编译错误:Undefined symbols for architecture x86_64
- python爬虫实例项目大全
- Keras深度学习框架学习笔记系列(1)- IndentationError错误问题
- 我的资源
- 【LeetCode】C# 90、Subsets II
- mysql四种存储引擎
- tf的“SAME”和“VALID”
- vue-cli webpack模板项目搭建以及打包时路径问题的解答
- ansible 可以登入,执行不了命令