Duplicate symbol issues

元气小坏坏 提交于 2019-11-29 21:12:50
Shameem

I had this issue on the latest Xcode 4. Cause: I included file.m instead of file.h

Possibly, you included TinCanViewController.m (should be TinCanViewController.h)

I had this happen but my problem was related to merge issues from our repo. The .m file was listed twice in a spot that it should only have been listed once (within the project, but not within the file/group structure, so you could not see the issue in Xcode, only the error). The fix is opening the .pbxproj file inside your project file and locating the duplicate entry in that file. After deleting the duplicate the project built just fine.

I happened to have included the .h file and the .m file twice in the project. Once I removed the second copy, the error went away.

Make sure delegate.m is only listed once within the Compile-Sources.

This problem solve here when I deleted (using Xcode) all files .m and .h from Class folder then I cleaned Project (Command + Shift + K) and Builded again. So I drag the files from Finder to Class Folder in Xcode again. Finally, I cleaned and build my Project again...

Good Luck !!!

I think this is a bug with Apple's latest linker when creating universal static libraries. I can;t find the bug number currently, but this happens because it incorrectly generates armv6 and armv7 without disambiguating them.

To verify if this is the case, change the configuration to build only armv6 or amv7, and you won't have this problem.

This could also happen if you have a multi-target project and two targets have same file like abc.m and that abc.m is selected for both targets.

What happened in my case was I had two targets named ABC and XYZ and both had their own DiagramViewController.m file which are supposed to run code for their targets. I accidentally had DiagramViewController.m of target ABC had target selected for XYZ also.

Solution :

Click on .m file go to file inspector and unselect additional target.

I had a same issue. the problem was that i had two libraries that contain same .m file.

like this

lib.a - for device.

libCauly-universal.a - for simulator and device.

so i deleted one.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!