编译期间的错误libcocos2dcpp.so

时间:2014-05-18 06:58:37

标签: cocos2d-x cocos2d-x-2.x

我正在使用Cocos2dx v2.2.2。使用" ./ build_native.sh"编译库时对于Android。我遇到了以下错误:

../android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/WSNode.o: in function WSNode::connect(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):jni/../../Classes/WSNode.cpp:106: error: undefined reference to 'SocketIO::connect(SocketIO::SIODelegate&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/WSNode.o: in function WSNode::disconnect():jni/../../Classes/WSNode.cpp:119: error: undefined reference to 'SIOClient::disconnect()'
../android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/WSNode.o: in function WSNode::emitString(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >):jni/../../Classes/WSNode.cpp:130: error: undefined reference to 'SIOClient::emit(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
../android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/WSNode.o: in function WSNode::registerEvent(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::function<void (SIOClient*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>):jni/../../Classes/WSNode.cpp:135: error: undefined reference to 'SIOClient::on(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (SIOClient*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>)'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libcocos2dcpp.so] Error 1
make: Leaving directory `../cocos2d-x-2.2.2/projects/Cocos2dxProject/proj.android'

任何帮助都将受到高度赞赏。

1 个答案:

答案 0 :(得分:0)

SIOClient在coco2d-x的v3.0中可用,请检查api here,2.2.2版本中没有。请尝试使用最新版本。