环境是cocos2d-x2.2 ,mac下使用xcode开发的。然后使用bulid_native.sh编译为android工程,各种报错,请帮忙看看什么问题。
SharedLibrary : libcocos2dcpp.so
/Users/YiJiang/ly/cocos2dx/android-ndk-r9c/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/LoginScene.o: in function Toast::create():jni/…/…/Classes/Toast.h:22: error: undefined reference to ‘Toast::Toast()’
上面这是其中一个,后面还报了好多类似的错误,在Toast.h文件的CREATE_FUNC(Toast);位置
//
// Toast.h
// AoeKill
//
// Created by on 14-2-5.
//
//
#ifndef __A _Toast__
#define __A _Toast__
#include "cocos2d.h"
#include "cocos-ext.h"
using namespace cocos2d;
using namespace cocos2d::extension;
class Toast:public CCNode{
public:
Toast();
~Toast();
void show(const char* text);
CREATE_FUNC(Toast);
virtual bool init();
private:
CCScale9Sprite* toastbg;
CCControlButton* btn;
bool hasshow;
bool hasadded;
void endShow();
};
#endif /* defined(__A _Toast__) */
```