duplicate symbol _OBJC_IVAR

2024-09-06 11:58
文章标签 duplicate symbol objc ivar

本文主要是介绍duplicate symbol _OBJC_IVAR,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

今天该死的SVN又TMD出问题,update之后出现了下面这种问题:

duplicate symbol _OBJC_IVAR_$_BDConversationCell._userNameLabel in: 某路径

该错误是一种链接错误,令人头疼的是Xcode不会直接定位到问题具体位置。

但其仍有一定的规律,大概是以下原因:

 

1.检查是否误导入了问题中类的 .m 文件;

报错:

复制代码
duplicate symbol _OBJC_IVAR_$_TestViewController._button in:/Users/Kingdev/Library/Developer/Xcode/DerivedData/测试OC-eluxicnvoptnsgcghlsslvbpkzzm/Build/Intermediates/测试OC.build/Debug-iphonesimulator/测试OC.build/Objects-normal/x86_64/ViewController.o/Users/Kingdev/Library/Developer/Xcode/DerivedData/测试OC-eluxicnvoptnsgcghlsslvbpkzzm/Build/Intermediates/测试OC.build/Debug-iphonesimulator/测试OC.build/Objects-normal/x86_64/TestViewController.o
ld: 3 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
复制代码

原因:

 

2.项目中是否存在同名的文件 [①多人协作开发导致project文件合并冲突 ②自己文件与三方中文件重名了]

报错:

复制代码
duplicate symbol _OBJC_IVAR_$_TestViewController._button in:/Users/Kingdev/Library/Developer/Xcode/DerivedData/测试OC-eluxicnvoptnsgcghlsslvbpkzzm/Build/Intermediates/测试OC.build/Debug-iphonesimulator/测试OC.build/Objects-normal/x86_64/TestViewController-B2E2C1AF4F6EA82.o/Users/Kingdev/Library/Developer/Xcode/DerivedData/测试OC-eluxicnvoptnsgcghlsslvbpkzzm/Build/Intermediates/测试OC.build/Debug-iphonesimulator/测试OC.build/Objects-normal/x86_64/TestViewController-969200155A7DEF4E.o
ld: 3 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
复制代码

原因:

 

若在项目中搜索中搜索发现,不存在同名的文件,就可判断出不是问题2。基本上就是问题3了。

 

3.在 TARGETS ——> Build Phases ——> Compiles Sources,看看出现问题的类是不是有重复的或路径出现了问题。多人协作开发时就容易出现这种问题,project文件冲突导致的。

若出现了如图:

UIImage+BDAdd.m 图标不显示m的。就是TA的问题,直接delete掉就搞定了


这篇关于duplicate symbol _OBJC_IVAR的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1141939

相关文章

JS中的【Symbol】全面讲解

1. 什么是 Symbol? Symbol 是 ES6 引入的一种新的原始数据类型(Primitive Data Type)。与 string、number、boolean、null 和 undefined 一样,Symbol 是不可变的原始值。Symbol 的特殊之处在于它是唯一的,即使两个 Symbol 的描述相同,它们的值也不相等。 2. Symbol 的创建 Symbol 通过 Sy

关于GDB运行时No symbol table is loaded. Use the “file“ command.的解决方法

最近有同学问GDB使用的问题,对此做一个整理。 首先,GDB已经报错file找不到了,那可以运行file test检测一下 (gdb) file testReading symbols from test...(no debugging symbols found)...done. 发现找不到可执行文件,所以问题应该在于编译时候没有加上ggdb3,重新编译一下 ty@ubuntu:

虚拟机MacOS安装Openssl ld: symbol(s) not found for architecture x86_64

最近开始搞MacOS下的开发,需要用到openssl,但是系统自带的openssl头文件还有库根本找不到,也不知道能不能用,于是就自己装一个 1.去网络上下载一个openssl的源码包 2.解压到自己有权限的目录下 3.在这一步,很多人用linux下的配置方法,我也是其中一个,踩了很大的坑,他们都是: sudo ./config --prefix=/usr/local/openssl 然

maven编译:Found duplicate... 问题的解决

1. 问题描述 一些开源的Java项目对依赖有着很严格的要求,会在root模块的pom.xml文件中,使用各种maven plugin检查依赖是否规范 apache的maven-dependency-plugin:可以检查是否存在unused dependency、used但未explicitly import的dependency等org.basepom.maven的duplicate-fin

wildfly10 部署缓存目录 wildfly Duplicate resource --gxy

/usr/local/wildfly-10.1.0.Final/standalone/data/content 如果部署有问题:比如说重复啊或者其他乱七八糟的错误的时候,进来这个目录二话不说全删了 如果报: 那么 1.要么把部署包名换一个; 2.要么在配置文件(standalone.xml)里面把配置删了,如下图:

What does `return x ? : 1` mean in C language? [duplicate] stackoverflow

#include <stdio.h>int f(int x){return x?:1;}int main(){printf("f %d\n", f(0));printf("f %d\n", f(1));return 0;} And got the following output f 1f 1 And when I change it to int f(int x){r

MySQL的INSERT ··· ON DUPLICATE KEY UPDATE使用的几种案例和说明

准备工作: 创建一张表,联合主键: create table test_insert_on_duplicate_key_update(id tinyint unsigned not null,birth_day date not null,score int unsigned not null,primary key(id, birth_day)) engine = InnoDB;

“undefined symbol: _ZTVN4aiui12AIUIListenerE“ 的含义与兼容方式

场景        由于项目需要,一套代码在两个产品上运行(开启不同的进程),但在其中一个硬件平台(假设为平台A)上并不需要使用讯飞语音服务的动态库 libaiui.so,所以为了节省平台A的存储空间,决定不把libaiui.so放进文件系统中. 遇到的问题        由于使用同一套代码,都连接了 libaiui.so,所以平台A上也需要一个 libaiui.so,但由于没有使用到里面的

Leetcode36: Contains Duplicate II

Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between iand j is at most k. 题目意

ImportError: /usr/lib/liblapack.so.3gf: undefined symbol: ATL_chemv

问题:ImportError: /usr/lib/liblapack.so.3gf: undefined symbol: ATL_chemv 解决方案: sudo apt-get remove libopenblas-base