Undefined reference error on SonarFrameworks.cpp

  • tripletoma
    Likes 0

    Problem Description

    Hello, I try to use SonarCocosHelper on my game project for iOS and Android. I got a lot of error like this.

    jni/../../Classes/SonarCocosHelperCPP/SonarFrameworks.cpp:60: error: undefined reference to 'JniHelpers::jniCommonBoolCall(char const*, char const*)'

    I think the problem is about linker but I can’t found how to solve it.

    I use Cocos Helper v1.46.00

    cocos2dx v.3.4

    ndk-r9d

     

  • OscarLeif
    Likes 0

    Hi tripletoma. 

    Please tell me about this problem it seems that you have problems with the SonarFrameworks.cpp file

    Did you change the header file ?

  • tripletoma
    Likes 0

    No, I didn’t change the header file. I just set up the project by following this https://www.youtube.com/watch?v=nb3246WCq-s&list=PLRtjMdoYXLf5JspHx7a8yUWGT0ohvPmVX&index=1

  • OscarLeif
    Likes 1

    Maybe it could be a problem with the files in the lastest commit in the github repo.

    Please try with this official release version

    https://github.com/SonarSystems/Cocos-Helper/releases

    Latest release v1.48.00

    I will try to test the most fast as I can the files if they’re ok.

    I’m not sure what pluggin are you using in the cocos helper but why is there a charboost folder in the c++ files ?
    Oh please if you can test cocos helper with a hello world project.


    This reply has been verified.
  • tripletoma
    Likes 0

    I have tried the v.1.48 but the error still occur. I think it isn’t problem about your code. Maybe something is wrong with my setup. I will check it again. Thank you

    FYI : Your code works fine on my iOS version.  

  • Sonar Systems admin
    Likes 0

    Keep us informed of your progress.

  • OscarLeif
    Likes 0

    When that happens to me it I try this, maybe you don’t import the project has an Android project.

    Or destroy that workspace create a new one and import your project again.

  • tripletoma
    Likes 0

    I found the problem. It is my typing error .cpp→.ccp on Android.mk file. I am so embarrassed LOL.

    Thank you very much for good support. :)

  • Sonar Systems admin
    Likes 0

    Great, it happens to the best of us.

  • tripletoma
    Likes 0

    FYI : I think you have skipped this post http://www.sonarlearning.co.uk/questions.php?question-topic=362 . I faced that problem aswell on v.1.48 and have solved it. 

    Everything work fine now. But why the first time I call Chartboost::preLoadFullscreenAd , the Ad poped-up.

    I used the code like this one.

    // declare this flag in your program

    bool AdPreloaded = false;

    // when you preload, change to this

    if( AdPreloaded == false )

    {

    PreLoadFullscreenAd();

    AdPreloaded = true;

    }

    // when you show, change to this

    ShowPreLoadedFullscreenAd(); 

    AdPreloaded = false;


  • Sonar Systems admin
    Likes 0

    Sorry my bad, is the other problem solved now?

  • tripletoma
    Likes 0

    I called Chartboost::preLoadFullscreenAd when player begin the level, but the Ad poped-up at that time. It should pop-up when only I call Chartboost::ShowFullscreenAd isn’t it. Or I misunderstand the procedure.

  • Sonar Systems admin
    Likes 1

    You have understood it correctly, there seems to be a bug in Cocos Helper, we are looking into it.

  • OscarLeif
    Likes 0

    Oh when I read about the mistake in the typing error I thought this was all, now I see that there’s more to do.cool

Login to reply