duplicate symbol Linker Errors on iOS

edited May 2013 in Native
I'm trying to copy the demo project settings into my own project, since I can't find any documentation on how to set it up. It seems to go OK, all the header files are found etc, until the final linker stage. I'm adding to Other Linker Flags:
-... ...libCommon-objc... ....a

When I add Photon-objc, I get lots of errors about duplicate symbols as it appears that they are defined in both Common-objc and Photon-objc, what can I do about this?


  • Your other linker flags look correct (I assume that these "..." are just there to shorten things up).
    Maybe its another setting. Would you mind posting the exact error log?
  • I'm getting lots of messages like this:
    duplicate symbol __ZN9ExitGames6Common10ANSIStringC1Ev in:

    I'm also a bit suspicious that I've included too much because I'm also getting a few of these (which reference both debug and release):
    duplicate symbol _OBJC_IVAR_$_EGLoadBalancingClient.mMasterserver in:

    My full Other Linker Flags (for the debug config) are:
  • TapOnFire wrote:
    Ah, here we have the problem.
    Please don't use all_load or you will get those duplicate symbol errors.
    In general using all_load isn't a good idea. Some libs in that case will complain about duplicate symbol errors, others will just blew up your app size with unneeded stuff. all_load works like if you would use force_load on every single lib that you link in. Instead its by far preferable to only use force_load on the libs that actually need it, to avoid issues with other libs.
    So you should identify, which libs actually get into trouble, when you throw out all_load and add a force_load on each of these and only these libs, just like you are already doing for Common-objc.

    Here is another thread about this topic:
Sign In or Register to comment.