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 ...
随机推荐
- 设计模式-2 简单工厂模式Factory Method
设计模式-2 简单工厂模式 1 意图: 定义一个用户创建对象的接口,让子类决定实例化那个类.Factory Method使一个类的实例化延迟到其子类 使用场景:将一个类的实例化延迟到其子类结构: 优缺 ...
- 数学和CNN里面的卷积和互相关
卷积和互相关 nndl上CNN这章的互相关讲的比较晦涩,简单辨析一下书上的互相关 A.1 数学意义上的卷积就是将卷积核进行翻转之后再进行我们熟悉CNN上的卷积运算 同时互相关就是不将卷积核翻转直接CN ...
- Java-将文本(字符串)转化成二进制字符
今天在测试MySQL的Blob相关类型时,这种一般存放的是二进制文本,所以就想插入二进制文本. package com.aaa.dao; public class aaa { public stati ...
- CentOS7环境源码安装freeswitch1.10.7
操作系统 :CentOS 7.6_x64 freeswitch版本 :1.10.7 一.安装步骤 1.下载freeswitch源代码 wget http://files.freeswitch.org/ ...
- NC210981 mixup2混乱的奶牛
题目链接 题目 题目描述 混乱的奶牛 [Don Piele, 2007] Farmer John的 N(4 <= N <= 16) 头奶牛中的每一头都有一个唯一的编号 \(S_i (1 & ...
- egrep命令
egrep命令 egrep命令用于模式搜索,属于grep函数族,工作原理和grep -E一样,其将模式视为扩展正则表达式,并打印出与模式匹配的行,如果有多个文件具有匹配的模式,其还能显示每行的文件名. ...
- Git实战系列教程
介绍 本文详细记录了Git一系列核心概念和工作中常用的操作命令,通篇以实际出发拒绝过度理论,值得典藏:). 概念 版本管理系统 版本控制是一种记录一个或若干文件内容变化,以便将来查阅特定版本修订情况的 ...
- 编译 windows 上的 qt 静态库
记录命令行编译过程: 针对 Qt 5.15.2 版本, 只需要 Source 文件就行 打开 x86 Native Tools Command Prompt for VS 2019,如果需要编译 x6 ...
- ADVMP 三代壳(vmp加固)原理分析(加壳流程)
开源项目地址 https://github.com/chago/ADVMP vmp 加固可以说时各大加固厂商的拳头产品了,这个开源项目虽然不是十分完善,让我们可以一览vmp加固的原理,是十分好的学习资 ...
- flutter打包android的一些配置修改(解决白屏,视频闪退)
1.打包后视频播放闪退 视频播放器选择了flutter_tencentplayer(https://github.com/qq326646683/flutter_tencentplayer) 解决:不 ...