Linker Command Failed

Discussion in 'How Can I...?' started by DingDong118, Jan 28, 2017.

  1. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    So now do I have to manually create a directory by the name of ads. If yes how do you do that.
    And you are saying MoPub framework should be inside that directory. What I do is ( as mentioned in builldbox article ) is to drag and drop MoPub SDK under BB Player (top one with blue color icon). Is what I am doing with MoPub SDK the wrong way ?
    This is what my current Xcode project looks like.
     

    Attached Files:

  2. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    This ads which is being created as a file and not a directory is because of my mistake or because of fault in Buildbox export ?
    The ads remain a file and not a directory even when I don't add MoPub SDK and make any changes.
     
  3. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Xcode 10 is good. Thats what I use.
    Ok, I am not concerned about your directory size, this could be caused by frameworks possibly.

    Anytime you see a linker error that means that Xcode can not find a specific file or library. In your case Xcode can not find MoPub because it has been told to look inside the "ads" directory, which you do not have. I am not sure how Xcode was told to look for MoPub in that directory. Since I don't use MoPub I believe when you did the setup you must have told your app/game to look for it in that directory. I suggest you backtrack to when you did the MoPub install, because that is the issue. Normally you would just place a framework file within the FrameWorks directory by just dragging and dropping it within Xcode. Some where Xcode was told to look for a "ads" directory. Do you remember setting it up like this?
     
  4. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
  5. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    I did not make any manual changes.
    I have no knowledge about programming and hence am not capable of making any manual changes on my own.
     
  6. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Yes, you installed correctly by dragging and dropping. And dragging and dropping it where you did should work. Now within a file inside Xcode, probably the AppDelegate.mm file, you need to place a reference to find that MoPub file that your dragged in by simply placing a import statement, Like I have here, however I am using AppsFlyer.
    #import <AppsFlyerLib/AppsFlyerTracker.h>

    Now you see that I am importing a file within the AppsflyerLib directory. You should have a file inside your MoPubSDK directory, which is what you dragged into your Xcode. Inside that directory there is a file that you want to import. So it would look like
    #import <MoPubSDK/filename>
    The filename will be named something like MoPubSDK.h or something like that with a ".h" extension. Not sure what the filename is called because I don't use MoPub.
     
  7. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Two things that might help. Do a screenshot of the code inside your AppDelegate.mm file, specifically I need to see the first 10 lines of code in that file.
    Secondly send a screenshot of what is inside the MoPubSDK directory in your Xcode.
     
  8. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    Surely.
    Here you go.
    First screenshot is of AppDelegate.mm and the second two screenshot of MoPub directory.
     

    Attached Files:

  9. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Ok. that helps.
    Now give me a screenshot of your AdIntegrator.h file
     
  10. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    here you go
     

    Attached Files:

  11. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Ok. Good. That appears to be setup correctly.
    When you dragged and dropped the MobPub library into Xcode, Xcode should have asked you if you wanted it to create a reference to the file. Do you remember if it did? You would have answered yes and Xcode should have built a reference to it.
    What I don't like and what doesn't look right to me is the MoPub frameworks directory that was dragged in. It has many sub-directories, which I am not used to seeing, but this may be normal, I don't use MoPub so I am struggling to see why so many files inside a Frameworks directory.
    Do a screenshot of your Adintegrator.mm file. I apologize for all of the screenshots, but I am trying to see what is going on here.
     
  12. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    No you don't need to apologies rather I should be thankful that you are helping me.
    Here you go.
    Screenshot for AdIntegrator.mm.
     

    Attached Files:

  13. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    I see one issue. Inside your AdIntergrator.h, change #import "MoPub.h" to #import <MoPubSDK/MoPub.h>
    You have quotation marks there, those should not be there.
     
  14. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    Ok I will do it.
     
  15. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Ok. these files look good. I think if you change the import statement it might work. Try it and let me know if you still get a linker error.
     
  16. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    Did that in AdIntegrator.h but an error came.
    Screenshot for that.
     

    Attached Files:

  17. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Crap. My bad. Change it, remove the < > and replace with " "
     
  18. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    Ok , will do that
    Did that but off no help
    This error still stays
     
  19. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Same error, linker?
     
  20. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    Yeah same error.
    Could it be a problem with Buildbox Export or steps mentioned in Buildbox Article. Or AdIntegrator.h or AdIntegrator.mm or MoPub SDK provided by Buildbox
     

Share This Page