Build failed due to Duplicate Symbol – cannot proceed. Need Help

Home Forums OpenEars Build failed due to Duplicate Symbol – cannot proceed. Need Help

Viewing 6 posts - 1 through 6 (of 6 total)

  • Author
    Posts
  • #1021300
    scottyistaken
    Participant

    I followed the tutorials when integrating OpenEars to my existing app, I googled a lot and tried many of the suggestions but still cannot fix this build failed duplicate symbol.
    I am using a device to build and not the simulator. I am using XCODE 5.1 and I downloaded the latest OpenEars distribution from your website. I am getting a duplicate symbol _update in:
    myapp/lib/Debug-iphoneos/myapp.framework/IOTmyapp
    /users/dev/Desktop/IOTmyappDebug/Framework/OpenEars.framework/OpenEars(OpenEars)
    ld: 1 duplicate symbol for architecture armv7

    I have done the following:
    1. Drag the Framework folder to my project and made sure that create groups for any added folders is selected and NOT create folder references. I diligently followed the steps in the tutorial.
    2. Check and there is no duplicate in Build Phases -> Compile Sources
    3. I remove the -all_load in other linker flag to isolate but problem exist.
    4. I tried to use lipo, ar to flatten and try to remove the duplicate symbol _update but it says ar: _update not found in archive
    5. Check if there is duplicate in framework but there is none.
    6. Check #import if I accidentally imported .m instead of .h and everything is fine.

    Please help as I cannot use OpenEars since I am stuck in the build phase. Any lead to troubleshoot this problem will be much appreciated.

    Thank you very much.

    #1021301
    Halle Winkler
    Politepix

    Welcome,

    Hmm, this looks a bit unexpected:

    myapp/lib/Debug-iphoneos/myapp.framework/IOTmyapp
    /users/dev/Desktop/IOTmyappDebug/Framework/OpenEars.framework/OpenEars(OpenEars)
    

    I don’t quite recognize why there would be a .framework for your app, and also why the folder ‘users’ in the directory leading to the OpenEars framework is lowercase on an OS X system. Can you give me some more information about the platform and structure of this project?

    #1021304
    scottyistaken
    Participant

    Thanks for your quick reply. Sorry, my bad. I gave pseudo names as I retype to another PC… Below is the cut-and-paste of the error from Xcode:

    duplicate symbol _update in:
    IOTCamViewer/lib/Debug-iphoneos/IOTCamera.framework/IOTCamera
    /Users/dev/Desktop/IOTCamViewerDebug/Framework/OpenEars.framework/OpenEars(OpenEars)
    ld: 1 duplicate symbol for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    The IOTCamera.framework is a third-party provided framework. Prior to adding the openears framework, the app build and run ok. After I copy the openear framework to the existing app and then build using device (not simulator), I get the duplicate symbol error. Hope you can help me as I am stuck and cannot move forward.

    Thank You!

    #1021305
    Halle Winkler
    Politepix

    OK, thank you for the background info – that makes it easier to help out.

    This could just be because each framework has a function called update, so when it was just IOTCamera there was only one update() function and then you added OpenEars and there were too many functions with that name.

    OpenEars’ function ‘update’ is declared in the file ac_hash.h, defined in the file ac_hash.c, and only referenced a single time in the file ac_lmfunc_impl.c on line 81 to the best of my knowledge. So, I would just rename it in these three places (I recommend “oe_update” or something like that), recompile the framework, and see if it clears up.

    If you’d like help with any specifics of that process, just let me know which part is giving difficulty.

    #1021306
    scottyistaken
    Participant

    Thank you so much. You rock!

    I changed the 3 files as per your suggestion, recompiled the OpenEars Framework and drag the framework to my app. I was able to build successfully. Will start using OpenEars and see how it goes.

    Happy weekend. I was blown away by your fast response. Best of all, it fixed the problem :)

    #1021308
    Halle Winkler
    Politepix

    Glad it helped!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.