一 写在前面的话:

音频算法仿真过程中,本来是一个跑的好好地程序,突然间在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问题解决的更多相关文章

  1. 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 问题原因 ...

  2. 模拟器运行报错:ld: symbol(s) not found for architecture x86_64

    模拟器运行报错: 报错信息如下: Undefined symbols for architecture x86_64: "_x264_encoder_open_142", refe ...

  3. 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 ...

  4. 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

  5. symbol(s) not found for architecture x86_64

    项目报错如下: ld: warning: ignoring file /xxxx/xxxx/ZBarSDK/libzbar.a ld: symbol(s) not found for architec ...

  6. 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 ...

  7. 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 ...

  8. symbol(s) not found for architecture x86_64 之 linker command failed with exit code 1 (use -v to see invocation)解决方案排查

    这样的错误 ,我的解决方案是, 第一种:   查看他说在 ****.o 中,你要查看这样的关键点,然后去查看,你 项目中有没有引进这样的文件,在项目中查找,看项目中有没有,如果没有那就是没添加进来,你 ...

  9. Qt: error: symbol(s) not found for architecture x86_64问题

    Mac上面报这个问题,结果是因为.h文件有函数没有实现.

  10. 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 ...

随机推荐

  1. npm旧淘宝镜像过期,更换新淘宝镜像

    1. 清空缓存 npm cache clean --force 2.设置新淘宝镜像 npm config set registry https://registry.npmmirror.com/ 3. ...

  2. SSM项目创建步骤(随手记)

    一.mybatis项目创建 1:创建maven项目 2:导入pom坐标 3:resources下创建SqlMapConfig.xml配置文件(主配置文件,配置数据库信息,映射配置文件等) 4:创建包及 ...

  3. Linux提取日志中的IP地址并去重

    原日志文件:logger.log  内容: {"peer":"kts_001","type":"http"," ...

  4. nginx适配thinkphp3.2.3

    环境 centos7.9 nginx1.23.2 thinkphp3.2.3 PHP7.4.30 配置 配置nginx 默认位置在/usr/local/nginx/conf/nginx.conf主要配 ...

  5. PVE上启用Intel核显的SR-IOV vGPU

    介绍 Intel SR-IOV vGPU是一种硬件虚拟化技术,它允许多个虚拟机共享单个物理GPU,而不会降低性能.SR-IOV定义了一种标准方法,通过将设备分区为多个虚拟功能来共享物理设备功能.每个虚 ...

  6. 【奶奶看了都会】云服务器ChatGLM模型fine-tuning微调,让你拥有自己的知识库

    1.背景 大家好啊,上次给大家写了ChatGLM-6B的部署使用教程,[奶奶看了都会]云服务器部署开源ChatGLM-6B,让你拥有自己的ChatGPT 但是因为模型比较小的问题,所以日常工作中可能用 ...

  7. 下载安装JDK 和 IntelliJ IDEA 和 ActiveMq

    wget http://yun.diandaxia.com/other/jdk-8u92-linux-x64.rpm rpm -ivh jdk-8u92-linux-x64.rpm wget http ...

  8. ehlib 排序后 滚动条 不对问题

    针对CDS的情况,作者的代码里 好像也不知道什么原因 必须写Cds.First但是,不写的话,就是不行,去掉作者的注释就可以了.

  9. docker基于commit方式为镜像添加SSH服务

    下载启动镜像 docker pull ubuntu: 18.04 docker run -it ubuntu:18.04 bash 配置软件源 备份/etc/apt/sources.list#备份cp ...

  10. 解决webservice接口调用报错:java.lang.ClassFormatError: Absent Code ... javax/mail/internet/MimeMultip

    今天使用java axis调用.net发布的webservice接口报了个错,排查半天,感觉代码逻辑没问题,最后发现是jar包冲突!!! 调用接口相关代码: String url="http ...