duplicate symbols for architecture arm64 after Xcode 8.0 update

前端 未结 10 1390
再見小時候
再見小時候 2020-12-31 08:46

I get duplicate symbols error after I updated my Xcode. (find the code down) Does anybody get this too? And how could be solved?

I tried to remove

相关标签:
10条回答
  • 2020-12-31 09:12

    I finally found it! You can compile after setting enable testability to NO in your Build settings.

    From The Xcode 8 Release Notes:

    When the Enable Testability build setting is enabled, Xcode 8 will pass -export_dynamic to the linker to preserve all global symbols for testing. This effectively overrides dead code stripping, which can expose link failures from unused functions that reference undefined symbols. If necessary, disabling testability will allow the link to proceed without source changes. (27684883)

    Of course, the best thing to do is to either: a) remove the unused code that is causing the linker issues, or b) actually fix the linker issues.

    0 讨论(0)
  • 2020-12-31 09:14

    Below Patch work for me..:)

    Code recommended to use warning flags and set GCC_NO_COMMON_BLOCKS to YES.

    Setting it back to NO solved the problem!

    0 讨论(0)
  • 2020-12-31 09:19

    From the error info, it must be some file dupicate in your project. Such as FilterAlertView, UserNotificationsViewController, SearchView, ExpressSliderCell...,And so on. You can see this in your error info.

    0 讨论(0)
  • 2020-12-31 09:23

    I found that I had constants declared in each 2 different classes, in .m file. This was allowed before this new version of xCode, but now appears like duplicate even those 2 classes don't import eachother and has nothing to do one with another.

    const NSInteger space = 10; <-- the name "space" should be unique over the app, even it's in .m file

    0 讨论(0)
提交回复
热议问题