cocos2d-x android compile ERROR - cocos2d-x

I can run my code in vc2012.
I need to compile my code to android so I use linux system to run ./build_native.sh
. Then terminal turn out this
StaticLibrary : libchipmunk.a
Compile thumb : cpufeatures <= cpu-features.c
StaticLibrary : libcpufeatures.a
SharedLibrary : libgame.so
/myData/Data/JAVA/adt-bundle-linux-x86_64-20130717/android-ndk-r8e/toolchains/arm-linux- androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux- androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/game_shared/__/__/Classes/AppDelegate.o: in function AppDelegate::applicationDidFinishLaunching():jni/../../Classes/AppDelegate.cpp:29: error: undefined reference to 'CPWScene::createScene()'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libgame.so] Error 1
make: Leaving directory `/myData/Workspace/C++/cocos2d-2.1rc0-x-2.1.3/Workspace/ClassDesgin/proj.android'

You have to add CPWScene.cpp file to Android.mk file so that compiler can compile the file. Android.mk file is located in proj.android/jni folder. In order to compile your project you need to list all your cpp files in Android.mk file.

Related

On Ubuntu 16.04, v8 build error

asiagaming#ubuntu:~/v8/v8$ make
make[1]: Entering directory '/home/asiagaming/v8/v8/out'
TOUCH bdc92efe44eca1954fdff70fd086c7e138d0fbb1.intermediate
ACTION Generating inspector protocol sources from protocol json bdc92efe44eca1954fdff70fd086c7e138d0fbb1.intermediate
CXX(target) /home/asiagaming/v8/v8/out/ia32.release/obj.target/v8_base/gen/src/inspector/protocol/Protocol.o
In file included from /home/asiagaming/v8/v8/out/ia32.release/obj/gen/src/inspector/protocol/Protocol.cpp:7:
In file included from /home/asiagaming/v8/v8/out/ia32.release/obj/gen/src/inspector/protocol/Protocol.h:8:
In file included from /home/asiagaming/v8/v8/out/ia32.release/obj/gen/src/inspector/protocol/Forward.h:8:
.././src/inspector/string-util.h:8:10: fatal error: 'memory' file not found
#include <memory>
^~~~~~~~
1 error generated.
src/v8_base.target.ia32.release.mk:750: recipe for target '/home/asiagaming/v8/v8/out/ia32.release/obj.target/v8_base/gen/src/inspector/protocol/Protocol.o' failed
make[1]: *** [/home/asiagaming/v8/v8/out/ia32.release/obj.target/v8_base/gen/src/inspector/protocol/Protocol.o] Error 1
rm bdc92efe44eca1954fdff70fd086c7e138d0fbb1.intermediate
make[1]: Leaving directory '/home/asiagaming/v8/v8/out'
Makefile:319: recipe for target 'ia32.release' failed
make: *** [ia32.release] Error 2
I've tried to build V8 engine, but above error msg is printed.
How to solve it ?
Does sudo apt-get install build-essential help?
(Side note: Simply invoking make is probably not what you want. Check out https://github.com/v8/v8/wiki/Building-with-GN.)

Cocos compile --android-studio

cocos2d-x 3.14.1, ndk r13b
'Standard' compile command works fine:
cocos compile -p android -m debug --ap android-23
I get an apparent link error when I compile using this command:
cocos compile -p android -m debug --ap android-23 --android-studio
Error:
jni/../../../Classes/AppDelegate.cpp:289: error: undefined reference to 'MainMenu::createScene()'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libMyGame.so] Error 1
Error running command, return code: 2.
Struggling with this - any ideas please?
It seems you haven't added the MainMenu class in Android.mk for Android Studio.
Open the android.mk from following path:
~project-directory/proj.android-studio/app/jni/android.mk
Add all the classes that you have in the following manner:
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../../Classes/AppDelegate.cpp \
../../../Classes/HelloWorldScene.cpp
Note: Edit the above classes with your actual names.HelloWorldScene.cpp is just used for representation purposes.

Unable to find lmdb while installing caffe with make all

/usr/bin/ld: cannot find -lmdb
collect2: error: ld returned 1 exit status
Makefile:568: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
How to get rid of this problem.
Make sure that the library file your are trying to use while compiling is present in the path that your have given while compiling...

clang++ Error when compiling the Minko engine SDK for HTML 5

I have followed all steps mentioned in Compiling the SDK for HTML5 to compile the Minko framework to HTML5.
When I run the batch file build_html5.bat, i have this error
000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
clang++.exe: error: clang frontend command failed with exit code 255 (use -v to see invocation)
ERROR root: compiler frontend failed to generate LLVM bitcode, halting
mingw32-make1: *** [obj/html5/release/Picking.o] Error 1
mingw32-make: *** [minko-framework] Error 2
Here is my Emscripten conf :
LLVM_ROOT='C:/Program Files/Emscripten/clang/e1.30.0_64bit'
EMSCRIPTEN_NATIVE_OPTIMIZER='C:/Program
Files/Emscripten/clang/e1.30.0_64bit/optimizer.exe'
NODE_JS='C:/Program Files/Emscripten/node/0.12.2_64bit/node.exe'
PYTHON='C:/Program Files/Emscripten/python/2.7.5.3_64bit/python.exe'
EMSCRIPTEN_ROOT='C:/Program Files/Emscripten/emscripten/1.30.0'
MINGW_ROOT='C:/Program Files/Emscripten/mingw/4.6.2_32bit'
JAVA='C:/Program Files/Emscripten/java/7.45_64bit/bin/java.exe'
Im on windows 7 64 bit.
Anyone know what causes this error and how can I resolve it?
This is a known problem with Emscripten 1.30, it should be resolved in future versions. For the moment, stick to Emscripten 1.29.

Load new module in Kamailio

I would like to ask, how can I load new module in Kamailio 4.1.2?
Actually, I have an issue, when I tried to compile my kamaiio.cfg
I've got error:
root#kamailio:/usr/local/# kamailio -c kamailio.cfg
loading modules under /usr/local/lib64/kamailio/modules/
0(25392) ERROR: <core> [sr_module.c:587]: load_module(): ERROR: load_module: could not find module <websocket> in </usr/local/lib64/kamailio/modules/>
0(25392) : <core> [cfg.y:3408]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 323, column 12-25: failed to load module
0(25392) ERROR: <core> [cfg.y:3272]: yyparse(): cfg. parser: failed to find command ws_handle_handshake
0(25392) : <core> [cfg.y:3411]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 1083, column 27: unknown command, missing loadmodule?
ERROR: bad config file (2 errors)
when I look physically to the /usr/local/lib64/kamailio/modules/ there is some modules, but websocket.so is missing.
So, how can I get and load module in Kamailio?
Thank you for help!
You haven't installed the module websocket. Edit modules.lst file in the source code directory and add websocket to include_modules variable. If you don't have modules.lst, just do:
make cfg
Alternative is to do:
make cfg include_modules="websocket"
By default, the build system for kamailio compiles and install only the modules that have the same dependencies as the core of the application. For websocket you need to install libunistring and openssl (libssl) devel packages.
Steps to load new module to Kamailio server. (Try if above answer is not working for you)
Check the modules is exist in the default module directly /usr/local/lib64/kamailio/modules.
If found, add loadmodule "module_name.so" in load module section in kamailio.cfg file.
If the module is not found in default module directory, you can check for the source code of that module in the default module source code directory /usr/local/src/kamailio-4.4/kamailio/modules.
If source code found, enter to the module directory. Then create modules' shared object file(.so) by following commands.
./configure
make
make test
make install
Then you will get a shared object file(.so). Copy that file into the default module directory. and load this module from the kamailio.cfg file as mentioned in step 1.
If module source code does not exist in the default source code directory, You need to download the source code from the web. And follow step 3 and 4.