1

Android の指示に基づいて ARM 用にクロス コンパイルしたいくつかの静的ライブラリにリンクしようとしています。いくつかの変数をロードできますが、そのうちの 1 つに苦労しています。

ld: error: undefined symbol: ACE_Time_Value::ACE_Time_Value(long, long)
  >>> referenced by VrCubeWorld_Framework.cpp:241 (jni/../../../Src/VrCubeWorld_Framework.cpp:241)
  >>>               /home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/objs/vrcubeworldfw/__/__/__/Src/VrCubeWorld_Framework.o:(OVRFW::VrCubeWorld::AppInit(OVRFW::ovrAppContext const*))
  >>> did you mean: ACE_Time_Value::ACE_Time_Value(long, long)
  >>> defined in: /home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/jni/../../../../../3rdParty/ACE_wrappers/build/target/lib/libTAO.a(ORB_Core.o)
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  make: *** [/home/smiller/Android/Sdk/ndk/22.0.7026061/build/core/build-binary.mk:728: /home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/libvrcubeworldfw.so] Error 1

LD フラグ:

['"/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/ld"',
 '-z',
 'noexecstack',
 '-EL',
 '--fix-cortex-a53-843419',
 '--warn-shared-textrel',
 '-z',
 'now',
 '-z',
 'relro',
 '-z',
 'max-page-size=4096',
 '--hash-style=gnu',
 '--enable-new-dtags',
 '--eh-frame-hdr',
 '-m',
 'aarch64linux',
 '-shared',
 '-o',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/libvrcubeworldfw.so',
 '/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtbegin_so.o',
 '-u',
 'ANativeActivity_onCreate',
 '-L/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/11.0.5/lib/linux/aarch64',
 '-L/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x',
 '-L/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib/../lib64',
 '-L/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/24',
 '-L/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android',
 '-L/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib',
 '-L/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib',
 '-soname',
 'libvrcubeworldfw.so',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/objs/vrcubeworldfw/__/__/__/Src/VrCubeWorld_Framework.o',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/libsampleframework.a',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/jni/../../../../../3rdParty/ACE_wrappers/build/target/lib/libTAO_AnyTypeCode.a',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/jni/../../../../../3rdParty/ACE_wrappers/build/target/lib/libTAO.a',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/jni/../../../../../3rdParty/ACE_wrappers/build/target/lib/libACE.a',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/libsamplecommon.a',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/libminizip.a',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/libstb.a',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/libandroid_native_app_glue.a',
 '/home/smiller/Android/Sdk/ndk/22.0.7026061/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_static.a',
 '/home/smiller/Android/Sdk/ndk/22.0.7026061/sources/cxx-stl/llvm-libc++abi/../llvm-libc++/libs/arm64-v8a/libc++abi.a',
 '-lgcc',
 '--exclude-libs',
 'libgcc.a',
 '--exclude-libs',
 'libgcc_real.a',
 '-latomic',
 '--exclude-libs',
 'libatomic.a',
 '/home/smiller/Development/Vandy/Term3/VR/ovr_strip1/VrSamples/VrCubeWorld_Framework/Projects/Android/build/intermediates/ndkBuild/release/obj/local/arm64-v8a/libvrapi.so',
 '--build-id=sha1',
 '--no-rosegment',
 '--no-undefined',
 '--fatal-warnings',
 '-lEGL',
 '-lGLESv3',
 '-landroid',
 '-llog',
 '-lz',
 '-lz',
 '-llog',
 '-landroid',
 '-lc',
 '-lm',
 '-lm',
 '-lgcc',
 '-ldl',
 '-lc',
 '-lgcc',
 '-ldl',
 '/home/smiller/Android/Sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtend_so.o']

Android.mk:

LOCAL_PATH := $(call my-dir)

######################################
#
# Static Libraries
#
#######################################

# ACE
include $(CLEAR_VARS)
LOCAL_MODULE := libACE
LOCAL_SRC_FILES := $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/lib/libACE.a
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target \
                    $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/TAO
include $(PREBUILT_STATIC_LIBRARY)

# TAO
include $(CLEAR_VARS)
LOCAL_MODULE := libTAO
LOCAL_SRC_FILES := $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/lib/libTAO.a
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target \
                    $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/TAO
include $(PREBUILT_STATIC_LIBRARY)

# TAO Any Type Code
include $(CLEAR_VARS)
LOCAL_MODULE := libTAOAnyTypeCode
LOCAL_SRC_FILES := $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/lib/libTAO_AnyTypeCode.a
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target \
                    $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/TAO
include $(PREBUILT_STATIC_LIBRARY)

##########################################
#
# Compiler Options
#
##########################################

include $(CLEAR_VARS)

include ../../../../cflags.mk

LOCAL_MODULE            := vrcubeworldfw

LOCAL_ARM_MODE := arm
LOCAL_ARM_NEON := true

LOCAL_CFLAGS         := -Werror


LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../../SampleCommon/Src \
                    $(LOCAL_PATH)/../../../../SampleFramework/Src \
                    $(LOCAL_PATH)/../../../../../VrApi/Include \
                    $(LOCAL_PATH)/../../../../../1stParty/OVR/Include \
                    $(LOCAL_PATH)/../../../../../1stParty/utilities/include \
                    $(LOCAL_PATH)/../../../../../3rdParty/stb/src \
                    $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target \
                    $(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/TAO \

LOCAL_CPPFLAGS += -frtti
LOCAL_CPPFLAGS += -fexceptions

LOCAL_SRC_FILES := ../../../Src/VrCubeWorld_Framework.cpp \
$(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/lib/libTAO_AnyTypeCode.a \
$(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/lib/libTAO.a \
$(LOCAL_PATH)/../../../../../3rdParty/ACE_wrappers/build/target/lib/libACE.a \

###################################################
#
# Linker Options
#
###################################################

LOCAL_LDLIBS := -lEGL -lGLESv3 -landroid -llog -lz
LOCAL_LDFLAGS += --verbose
LOCAL_LDFLAGS += 

LOCAL_STATIC_LIBRARIES := sampleframework
LOCAL_STATIC_LIBRARIES += libTAOAnyTypeCode libTAO libACE

LOCAL_SHARED_LIBRARIES := vrapi

include $(BUILD_SHARED_LIBRARY)

$(call import-module,VrApi/Projects/AndroidPrebuilt/jni)
$(call import-module,VrSamples/SampleFramework/Projects/Android/jni)

nm -Ca .../libTAO.a | grep ACE_Time_Value::ACE_Time_Value出力:

0000000000000000 W ACE_Time_Value::ACE_Time_Value(long, long)

いろいろ試してみましたが、何もうまくいかないようです。私が間違っていることについてアドバイスや助けをいただければ幸いです。

4

1 に答える 1