Привет у меня проблема с компиляцией проекта для Android — он работает нормально для Win32 и BB10
но когда я пытаюсь скомпилировать его в Android NDK, я получаю следующие сообщения:
[armeabi] SharedLibrary : libcocos2dcpp.so
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: multiple definition of 'AppDelegate::applicationDidEnterBackground()'
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: previous definition here
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: multiple definition of 'AppDelegate::applicationWillEnterForeground()'
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: previous definition here
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: multiple definition of 'vtable for AppDelegate'
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: previous definition here
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: multiple definition of 'AppDelegate::AppDelegate()'
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: previous definition here
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: multiple definition of 'AppDelegate::AppDelegate()'
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: previous definition here
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: multiple definition of 'AppDelegate::loadResources()'
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: previous definition here
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: multiple definition of 'AppDelegate::applicationDidFinishLaunching()'
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: previous definition here
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: multiple definition of 'typeinfo name for AppDelegate'
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: previous definition here
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: multiple definition of 'typeinfo for AppDelegate'
C:/androidsdk/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o: previous definition here
collect2.exe: error: ld returned 1 exit status
/cygdrive/c/androidsdk/ndk/android-ndk-r10/build/core/build-binary.mk:647: recipe for target 'obj/local/armeabi/libcocos2dcpp.so' failed
Может кто-нибудь сказать мне, что я делаю не так?
кокосы 2.4
У меня тоже была такая же проблема с другой библиотекой. В моем случае это произошло потому, что в Android.mk в LOCAL_SRC_FILES один и тот же файл c был указан 2 раза. В вашем случае это может быть AppDelegate.cpp