Duplicate symbol issues

后端 未结 8 889
Happy的楠姐
Happy的楠姐 2020-12-24 00:22

During a refactor of an iOS project, I ran into this bear of a bug. During the linking phase, I get this message:

ld: duplicate symbol _OBJC_IVAR_$_Ti

8条回答
  •  温柔的废话
    2020-12-24 01:04

    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.

    enter image description here

提交回复
热议问题