ld: symbol(s) not found for architecture x86_64问题解决
一 写在前面的话:
音频算法仿真过程中,本来是一个跑的好好地程序,突然间在mac下就报错了,出现的错误是:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
神马错误?运行程序很多年,还是第一次见这种错误啊。到底是什么问题呢?
二 解决思路:
针对这种不是一下看出问题的地方,我就使用了简化法,看看到底是什么鬼。精简了很多代码,发现不是代码出了问题,而是编译器这块出了问题,外事不懂问谷歌,搜一下吧,也许能给你灵感了。
果真如此,在一个小角落里,我发现了这段话:
I had a similar warning/error/failure when I was simply trying to make an executable from two different object files (main.o and add.o). I was using the command:
gcc -o exec main.o add.o
But my program is a C++ program. Using the g++ compiler solved my issue:
g++ -o exec main.o add.o
I was always under the impression that gcc could figure these things out on its own. Apparently not. I hope this helps someone else searching for this error.
三 解决方法:
查看自己的Makefile文件,才发现这个是使用的g++,改一下试一下,把它改成gcc之后,马上好了。哈哈,看来是编译器捣的鬼啊。
四 反思:
这种问题,暴露了自身的基础知识还不够扎实啊,看来还要多多学习,多多学习。
ld: symbol(s) not found for architecture x86_64问题解决的更多相关文章
- Xcode调用旧版本库出现Undefined symbols for architecture x86_64: ld: symbol(s) not found for architecture x86_64
问题:Undefined symbols for architecture x86_64: ld: symbol(s) not found for architecture x86_64 问题原因 ...
- 模拟器运行报错:ld: symbol(s) not found for architecture x86_64
模拟器运行报错: 报错信息如下: Undefined symbols for architecture x86_64: "_x264_encoder_open_142", refe ...
- iOS编译错误#ld: warning: ignoring file# 之 Undefined symbols for architecture x86_64 - ld: symbol(s) not found for architecture x86_64
ld: warning: ignoring file xxxPath/libbaidumapapi.a, missing required architecture x86_64 in file xx ...
- mac 关于使用protobuf出现ld: symbol(s) not found for architecture x86_64的问题
主要是编译时没有添加protobuf库文件 g++ -o Writer.o lm.helloworld.pb.cc Writer.cpp -L/usr/local/lib -lprotobuf
- symbol(s) not found for architecture x86_64
项目报错如下: ld: warning: ignoring file /xxxx/xxxx/ZBarSDK/libzbar.a ld: symbol(s) not found for architec ...
- Undefined symbols for architecture armv7: "_OBJC_METACLASS_$_ _OBJC_CLASS_$_ ld: symbol(s) not found for architecture armv7错误
Undefined symbols for architecture armv7: "_OBJC_METACLASS_$_MWPhotoBrowser", referenced ...
- cmake: error: symbol(s) not found for architecture x86_64 mac os 使用boost asio
最近在使用boost的asio库,在mac osx 上编写网络服务程序报错: :-1: error: symbol(s) not found for architecture x86_64 然后在CM ...
- symbol(s) not found for architecture x86_64 之 linker command failed with exit code 1 (use -v to see invocation)解决方案排查
这样的错误 ,我的解决方案是, 第一种: 查看他说在 ****.o 中,你要查看这样的关键点,然后去查看,你 项目中有没有引进这样的文件,在项目中查找,看项目中有没有,如果没有那就是没添加进来,你 ...
- Qt: error: symbol(s) not found for architecture x86_64问题
Mac上面报这个问题,结果是因为.h文件有函数没有实现.
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_The49DayPersonalFullscreenGiftModel", referenced from: objc-class-ref in The49DayPersonalRoomGiftModel.o ld: symbol(s) not found for a
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_The49DayPersonalFullscreenGiftModel&q ...
随机推荐
- mysql 索引优化 explain,复合索引,联合索引,优化 user_base 和 log_login 实战
本节是关于MySQL的复合索引相关的知识,两个或更多个列上的索引被称作复合索引,本文主要介绍了mysql 联合索引生效的条件及失效的条件 对于复合索引:Mysql从左到右的使用索引中的字段,一个查询可 ...
- Python-目录下相同格式的Excel文件合并
最近在客户现场接到一个任务,需要将全国所有省份的数据进行合并.目录是分层级的,首先是省份目录.然后地级市目录.最里面是区县目录.需要将每个目录中的数据进行合并,然后添加4列数据,并将某一个列的数据进行 ...
- MySQL创建函数报错:1418 - This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled
创建函数时报错: 1418 - This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaratio ...
- WebAssembly照亮了 Web端软件的未来
WebAssembly的发展历程相对较短,但影响深远.WebAssembly 于 2015 年首次发布,先驱技术是来自Mozilla的asm.js和Google Native Client,最初的实现 ...
- NVME(学习笔记三)—PMR
PMR(Persistent Memory Region)持久性内存区域 NVM Express在2019年完成了NVMe 1.4规范的制定,新的NVMe协议带来了大量的全新特性,尤其在纠错.强化性能 ...
- Shiro-00-shiro 概览
RBAC RBCA RBCA zh_CN Shiro Apache Shiro 是一个强大且易于使用的 Java 安全框架,负责执行身份验证.授权.加密和会话管理. 通过 Shiro 的易于理解的 A ...
- 【Unity3D】广告牌特效
1 前言 广告牌特效是指:空间中的一个 2D 对象始终(或尽可能)面向相机,使得用户能够尽可能看清楚该 2D 物体.广告牌特效一共有以下 3 种: 正视广告牌:广告牌始终以正视图姿态面向相机,即广 ...
- 【Unity3D】分离路面导航
1 前言 导航系统中介绍了导航的基本用法,但是不能解决分离路面导航问题.如下图,胶囊体需要导航到立方体位置,但是路面不连续,烘焙(Bake)导航网格后,断开处也没有导航网格,因此,胶囊体导航到分离 ...
- 从零开始学Spring Boot系列-前言
从零开始学Spring Boot系列-前言 在数字化和信息化的时代,Java作为一种成熟.稳定且广泛应用的编程语言,已经成为构建企业级应用的首选.而在Java生态系统中,Spring框架无疑是其中最为 ...
- 编译 windows 上的 qt 静态库
记录命令行编译过程: 针对 Qt 5.15.2 版本, 只需要 Source 文件就行 打开 x86 Native Tools Command Prompt for VS 2019,如果需要编译 x6 ...