1个x86_64体系结构的重复符号 [英] 1 duplicate symbol for architecture x86_64

查看:91
本文介绍了1个x86_64体系结构的重复符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我做错了什么.
我将项目文件夹移动到了另一个文件夹,并将备份文件夹复制到了桌面.
我试图打开备份项目并进行构建,但收到链接器错误.
因此,我决定删除备份文件夹,然后将项目文件夹移回桌面.我无法再编译,并收到以下错误.

I am not sure what I have done wrong.
I moved my project folder to another folder and copied the backup folder to desktop.
I tried to open the backup project and build, I received the linker error.
So I decided to I delete my backup folder and moved back my project folder to desktop. I can't compile anymore and received the following error.

 Showing Recent Issues clang: error: linker command failed with exit code 1 (use -v to see invocation)

duplicate symbol _main in:
/Users/BRO/Library/Developer/Xcode/DerivedData/SFITNESS-flzvwdymttxhducvwvmhpuaqfzhj/Build/Intermediates.noindex/SFITNESS.build/Debug-iphonesimulator/SFITNESS.build/Objects-normal/x86_64/main-90EC778DD760FD57.o
/Users/BRO/Library/Developer/Xcode/DerivedData/SFITNESS-flzvwdymttxhducvwvmhpuaqfzhj/Build/Intermediates.noindex/SFITNESS.build/Debug-iphonesimulator/SFITNESS.build/Objects-normal/x86_64/main-F627C2B37F247040.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)  

1.我打开了派生数据"文件夹并删除了其中的所有内容
2.我删除所有模拟器中的所有项目
3.我重新启动了xCode,清理并构建

1. I opened Derived Data folder and deleted everything in it
2. I deletes all the project in all simulator
3. I restarted xCode, Clean and build

还是一样

链接

推荐答案

您需要在项目中添加必要的框架.检查所有第三方框架,并搜索其所需的框架以获取支持.例如如果添加google analytic,则需要使用add CoreDataFoundation等框架.缺少第三方框架需要的某些框架.

You need to add necessary framework to your project. Check all third party party framework and search its required framework for support. For e.g. if you add google analytic then you need to add CoreData , Foundation etc framework. There is some framework is missing for which third party framework needs.

或者您可以-

  1. "Cmd + Shift + K"shift + cmd + alt + k进行清理,然后退出Xcode.
  2. 删除缓存运行"rm -rf ~/Library/Developer/Xcode/DerivedData" 在终端中

  1. Press "Cmd + Shift + K" or shift + cmd + alt + k to clean up, and quit Xcode.
  2. Delete the cache Run "rm -rf ~/Library/Developer/Xcode/DerivedData" in terminal

打开项目并重新构建

Linker command failed with exit code 1-要解决此错误,请按"Cmd + Shift + K"shift + cmd + alt + k,这将为您完成工作.我也有同样的问题,但通过使用此行解决了.希望这能解决您的问题.

Linker command failed with exit code 1 - to solve this error press "Cmd + Shift + K" or shift + cmd + alt + k this will do the work for you. I also have this same issue but solved by using this line . Hope this will solve your problem.

您的项目的输出-

这篇关于1个x86_64体系结构的重复符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆