Cocos2d X Error Undefined Reference To Vtable For
Contents |
the final step error undefined reference to vtable for qt (adding the gameOverScene) of tutorial, a weird error
Undefined Reference To Vtable For Constructor
occurs :/home/eddyxd/Android/Git/game/Cocos2dx/HelloWorld/android/obj/local/armeabi/objs-debug/game_logic/HelloWorldScene.o: In function `GameOverScene’:/home/eddyxd/Android/Git/game/Cocos2dx/HelloWorld/android/jni/../../Classes/GameOverScene.h:47: undefined reference to `vtable for GameOverScene’/home/eddyxd/Android/Git/game/Cocos2dx/HelloWorld/android/obj/local/armeabi/objs-debug/game_logic/HelloWorldScene.o: undefined reference to vtable for class In function `GameOverScene::node()‘:/home/eddyxd/Android/Git/game/Cocos2dx/HelloWorld/android/jni/../../Classes/GameOverScene.h:50: undefined reference to `GameOverScene::init()’ I googled everywhere, and found it might caused by two reasons :1. typo
Undefined Reference To Vtable Destructor C++
: as the thread : http://www.cocos2d-x.org/boards/6/topics/2943?r=2949\#message-29492. makefile for jni : as the thread : http://gameit.ro/2011/08/adding-a-new-cpp-file-to-the-android-build-process-or-how-to-handle-the-undefined-reference-to-vtable-for-gameoverscene-error/ However, both of them do not work I copy the code directly from website, so there is impossible a typo.Moreover, I have added these q_object undefined reference to vtable source files to the jni/helloworld/Android.mk, as :LOCAL_SRC_FILES := main.cpp ../../../Classes/AppDelegate.cpp ../../../Classes/HelloWorldScene.cpp ../../../Classes/GameOverScene.cpp This error still jumps out when I compile it! Can anyone help me? I think that it must be a bug. junechiu 2012-02-23 12:13:21 UTC #2 Lixin Lou wrote: Everything about cocos2dx is so fine before I try to add a new scene as tutorial in here : http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Chapter\_7*-*Some\_Icing\_on\_the\_Cake>In the final step (adding the gameOverScene) of tutorial, a weird error occurs :/home/eddyxd/Android/Git/game/Cocos2dx/HelloWorld/android/obj/local/armeabi/objs-debug/game_logic/HelloWorldScene.o: In function `GameOverScene’:/home/eddyxd/Android/Git/game/Cocos2dx/HelloWorld/android/jni/../../Classes/GameOverScene.h:47: undefined reference to `vtable for GameOverScene’/home/eddyxd/Android/Git/game/Cocos2dx/HelloWorld/android/obj/local/armeabi/objs-debug/game_logic/HelloWorldScene.o: In function `GameOverScene::node()‘:/home/eddyxd/Android/Git/game/Cocos2dx/HelloWorld/android/jni/../../Classes/GameOverScene.h:50: undefined reference to `GameOverScene::init()’>>I googled everywhere, and found it might caused by two reasons :1. typo : as the thread : http://www.cocos2d-x.org/boards/6/topics/2943?r=2949\#message-29492. makefile for jni : as the thr
it on iOS, in fact the game is avaivable on the Apple Store. I’m http://discuss.cocos2d-x.org/t/gameoverscene-h-47-undefined-reference-to-vtable-for-gameoverscene/1407 using NDK r8d and lastest SDK, but I’m encountering a lot of issues when trying to build. My application.mk is like this: APP_STL := stlport_sharedAPP_CPPFLAGS := ~~frttiNDK_TOOLCHAIN_VERSION=4.7Android.mk:LOCAL_PATH := http://discuss.cocos2d-x.org/t/various-error-undefined-reference-to/5584 \$>include \$>ifdef STLGLOCAL_MODULE := stlport_stlgelseLOCAL_MODULE := stlportendifLOCAL_CFLAGS = ~~DANDROID* >~~isystem \$/usr/include > LOCAL_MODULE := game_shared>LOCAL_MODULE_FILENAME := libgame>LOCAL_CPPFLAGS*=~~fexceptions>>LOCAL_C_INCLUDES := \$(LOCAL_PATH)/../../ClassesLOCAL_C_INCLUDES := \$(LOCAL_PATH)/../../Classes \$(LOCAL_PATH)/../../../../Box2D \$(LOCAL_PATH)/../../../../cocos2dx \$(LOCAL_PATH)/../../../../>LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static>include \$(BUILD_SHARED_LIBRARY)>\$(call import-module,CocosDenshion/android) > \$(call import-module,cocos2dx) > \$(call import-module,extensions)>Here’s the console log (only errors displayed): /Users/arianna/android/android-ndk-r8d/sources/cxx-stl/stlport/stlport/stl/_alloc.h:158: error: undefined reference to ’std::node_alloc::M_allocate‘make: Leaving directory `/Users/arianna/android/cocos2d-2.0-x-2.0.4/grannnnnnny/proj.android’/Users/arianna/android/android-ndk-r8d/sources/cxx-stl/stlport/stlport/stl/_alloc.h:161: error: undefined reference to ’std::node_alloc::M_deallocate‘/Users/arianna/android/android-ndk-r8d/sources/cxx-stl/stlport/stlport/stl/_string.c:600: error: undefined reference to ’std::stl_throw_length_error’/Users/arianna/android/cocos2d-2.0-x-2.0.4/grannnnnnny/proj.android/../../cocos2dx/actions/CCActionInterval.cpp:386: error: undefined reference to ’dynamic_cast’/Users/arianna/android/cocos2d-2.0-x-2.0.4/grannnnnnny/proj.android/../../cocos2dx/actions/CCActionInterval.cpp:1783: error: undefined reference to ‘dynamic_cast’/Users/arianna/android/cocos2d-2.0-x-2.0.4/grannnnnnny/proj.android/../../cocos2dx/actions/CCActionInterval.cpp:1838: error: undefined reference to ’dynamic_cast’/Users/arianna/android/cocos2d-2.0-x-2.0.4/grannnnnnny/proj.android/../../cocos2dx/actions/CCActionInterval.cpp:1906: error: undefined reference to ’dynamic_cast’/Users/arianna/android/android-ndk-r8d/sources/cxx-stl/stlport/stlp
But in fact each of them is defined and declaration can de opened with "right click". Cocos2dx version is 3.2. In xcode it compiles without problems (for undefined reference mac os and ios). Any advice? Here is eclipse console log:python /Users/anton_tutarinov/Documents/Projects/Cocos2dx/TradingCenter/proj.android/build_native.py -b release all Android NDK: WARNING:jni/../../cocos2d/cocos/./Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries Android NDK: WARNING:jni/../../cocos2d/cocos/platform/android/Android.mk:cocos2dxandroid_static: LOCAL_LDLIBS is always ignored undefined reference to for static libraries make: Entering directory `/Users/anton_tutarinov/Documents/Projects/Cocos2dx/TradingCenter/proj.android'[armeabi] Compile++ thumb: cocos2dcpp_shared <= main.cpp[armeabi] Compile++ thumb: cocos2dcpp_shared <= AppDelegate.cpp ....[armeabi] SharedLibrary : libcocos2dcpp.sojni/../../Classes/MainScene.cpp:36: error: undefined reference to 'cocos2d::ui::ImageView::create()'jni/../../Classes/MainScene.cpp:38: error: undefined reference to 'cocos2d::ui::ImageView::loadTexture(std::__1::basic_string, std::__1::allocator > const&, cocos2d::ui::Widget::TextureResType)'jni/../../Classes/MainScene.cpp:62: error: undefined reference to 'cocos2d::ui::ImageView::loadTexture(std::__1::basic_string, std::__1::allocator > const&, cocos2d::ui::Widget::TextureResType)'jni/../../Classes/MainScene.cpp:66: error: undefined reference to 'cocos2d::ui::ImageView::loadTexture(std::__1::basic_string, std::__1::allocator > const&, cocos2d::ui::Widget::TextureResType)'jni/../../Classes/MainScene.cpp:71: error: undefined reference to 'cocos2d::ui::ImageView::loadTexture(std::__1::basic_string, std::__1::allocator > const&, cocos2d::ui::Widget::TextureResType)'jni/../../Classes/MenuWidget.cpp:24: error: undefined reference to 'cocos2d::ui::Widget::Widget()'jni/../../Classes/MenuWidget.cpp:24: error: undefined reference to 'cocos2d::ui::Widget::Widget()'jni/../../Classes/MenuWidget.cpp:35: error: undefined reference to 'cocos2d::ui::Widget::~Widget()'jni/../../Classes/MenuWidget.cpp:39: error: undefined reference to 'cocos2d::ui::Widget::init()'jni/../../Classes/MenuWidget.cpp:48: error: undefined reference to 'cocos2d::ui::Button::create()'jni/../../Classes/MenuWidget.cpp:50: error: undefined reference to 'cocos2d::ui::Button::