新手第一次打包apk,打包的时候出现这个错误
StaticLibrary : libcpufeatures.a
SharedLibrary : libcocos2dcpp.so
./obj/local/armeabi/objs/cocos2dcpp_shared///Classes/GameObject/Bird.o:Bird.cpp:vtable for Bird: error: undefined reference to ‘cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)’
./obj/local/armeabi/objs/cocos2dcpp_shared///Classes/GameObject/BlackCloud.o:BlackCloud.cpp:vtable for BlackCloud: error: undefined reference to ‘cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)’
./obj/local/armeabi/objs/cocos2dcpp_shared///Classes/GameObject/SpecialTool.o:SpecialTool.cpp:vtable for SpecialTool: error: undefined reference to ‘cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)’
collect2.exe: error: ld returned 1 exit status
make.exe: *** Error 1
我写的这三个类时派生于Sprite的,这错误好像是说他们的虚函数表中没有setDisplayFrameWithAnimationName这个函数,但是打开CCSprite.h文件是有这个函数的声明的啊,而且在VS2012中写完代码运行的时候都没有提示这个,这是为什么啊,应该怎么改呢,求大神解答一发。。。
另外,cocos2dx是3.5版本,就是frameworks中自带的那个
下面是打包中输出的全部信息:
发布项目成功
Based on: cocos2d-x-3.5
Running command: upgrade
Current version ‘cocos2d-x-3.5’ is same with target version ‘cocos2d-x-3.5’. It’s NOT necessary to upgrade project.
Based on: cocos2d-x-3.5
Updated project.properties
Updated local.properties
Updated file F:\Cocos\Projects\BalloonFly\proj.android\proguard-project.txt
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
make.exe: Entering directory F:/Cocos/Projects/BalloonFly/proj.android' StaticLibrary : libcpufeatures.a SharedLibrary : libcocos2dcpp.so ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/GameObject/Bird.o:Bird.cpp:vtable for Bird: error: undefined reference to 'cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)' ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/GameObject/BlackCloud.o:BlackCloud.cpp:vtable for BlackCloud: error: undefined reference to 'cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)' ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/GameObject/SpecialTool.o:SpecialTool.cpp:vtable for SpecialTool: error: undefined reference to 'cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)' collect2.exe: error: ld returned 1 exit status make.exe: *** Error 1 make.exe: Leaving directory F:/Cocos/Projects/BalloonFly/proj.android’
Running command: compile
Building mode: debug
Android platform not specified, searching a default one…
running: ‘“F:\Cocos\Android\android-sdk-windows\tools\android” update project -t android-20 -p F:\Cocos\Projects\BalloonFly\proj.android’
building native
NDK build mode: release
NDK_TOOLCHAIN_VERSION: 4.9
running: ‘“F:\android-ndk-r10d\ndk-build” -C F:\Cocos\Projects\BalloonFly\proj.android -j3 NDK_MODULE_PATH=F:\Cocos\Framework\frameworks/cocos2d-x-3.5;F:\Cocos\Framework\frameworks/cocos2d-x-3.5/cocos;F:\Cocos\Framework\frameworks/cocos2d-x-3.5/external NDK_TOOLCHAIN_VERSION=4.9’
Ndk build failed!
项目打包失败


