Search code examples
androidubuntu-12.04cocos2d-x

Compile Cocos2d-x on Ubuntu 10.04 LTS


I'm just getting started using Ubuntu to develop Android project with Cocos2d-x recently. I cloned the lastest Cocos2d-x code from GitHub, and installed the Android NDK r8.

Then I compiled hello-jni with no problem. So I used create-android-project.sh inside by creating a test project, then success. But when I used ./build_native.sh compiled the project when an error. The error is as follows:

Compile++ thumb  : cocosdenshion_static <= SimpleAudioEngineJni.cpp
Compile++ thumb  : cocosdenshion_static <= OpenSLEngine.cpp
/home/zhonglong/cocos2d-2.1beta3-x-2.1.0/mycocos2d/proj.android/../../CocosDenshion/android/opensl/OpenSLEngine.cpp:292:23: error: 
      expected expression
        (player->audioSrc) = {&loc_fd, &format_mime};
                         ^

Is that someone can help me?


Solution

  • Try Changing this line

    Line 292: (player-> audioSrc) = {& loc_fd, & format_mime};
    

    To this and see if it works

    Player-> audioSrc.pLocator = & loc_fd;         : line 292
    Player-> audioSrc.pFormat = & format_mime;     : line 293