Xcode, Duplicate symbol _main

前端 未结 10 862
抹茶落季
抹茶落季 2020-11-30 03:14

I have duplicate symbol _main.

The problem is it says \"Duplicate symbol _main in /Users/.../i386/main-B9843B6026D6EFA4.o and /Users/.../i386/main-B9843B6026D6EFA4.o

10条回答
  •  死守一世寂寞
    2020-11-30 03:16

    You can get this for method names too!

    I got duplicate symbol _runOnMainQueueWithoutDeadlocking after adding DBCamera via CocoaPods and it was because both my category on NSObject (NSObject+Tools.h) and the GPUImage dependency file GPUImageOutput.m both had a method called 'runOnMainQueueWithoutDeadlocking'.

    I was fortunate enough to be able to remove my method from code because I wasn't actually using it anymore or anywhere.

    It's probably what I deserve for putting a category on NSObject.

提交回复
热议问题