/home/jonyguo/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/jonyguo/hm/LDR/obj/local/armeabi-v7a/objs/ldr_neon/LDREnhancement.o: in function LDR_Enhancement_YUV(unsigned char*, unsigned int, unsigned int, unsigned char*):/home/jonyguo/hm/LDR/jni/LDREnhancement.cpp:71: error: undefined reference to 'YUV_to_HSV_neon(unsigned char*, unsigned char*, unsigned char*, unsigned char*, unsigned char*, unsigned char*, unsigned int, unsigned int)'
在调用arm汇编函数的c文件中,已经包含extern 语句
extern void YUV_to_HSV_neon( unsigned char * in_Y_arm,......)。
'YUV_to_HSV_neon这个函数是被C函数调用的arm汇编函数。
在对应的汇编文件文件中,我按照网上介绍的,使用了export
.text
.fpu neon
.arch armv7a
.arm
.global YUV_to_HSV_neon
.func YUV_to_HSV_neon
export YUV_to_HSV_neon
YUV_to_HSV_neon:
in_Y .req r0
in_U .req r1
.....
此时,又提示, Error: bad instruction `export YUV_to_HSV_neon'
但是去掉了,又出现了:undefined reference to 'YUV_to_HSV_neon
由于刚刚接触arm汇编,不知道怎么处理,恳求各位大神指点。
7 个解决方案
#1
makefile貼出來看看
#2
这是makefile:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := opencv_java
LOCAL_SRC_FILES := $(LOCAL_PATH)/libopencv_java.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := ldr_neon
LOCAL_SRC_FILES := \
ImgProcessing.cpp \
ColorSpace_Conversion.cpp \
LDREnhancement.cpp \
main.cpp \
utils.cpp \
imgProcessing_arm.S \
imgProcess_neon.cpp.neon \
CLAHE.cpp.neon
LOCAL_SHARED_LIBRARIES := \
opencv_java
LOCAL_CFLAGS :=-O3 -D__cpusplus -g -mfloat-abi=softfp -mfpu=neon -march=armv7-a -mtune=cortex-a15
TARGET_ARCH_ABI :=armeabi-v7a
LOCAL_ARM_MODE := arm
LOCAL_ARM_NEON := true
LOCAL_C_INCLUDES := \
./include \
./include/opencv \
./include/opencv2 \
include $(BUILD_EXECUTABLE)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := opencv_java
LOCAL_SRC_FILES := $(LOCAL_PATH)/libopencv_java.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := ldr_neon
LOCAL_SRC_FILES := \
ImgProcessing.cpp \
ColorSpace_Conversion.cpp \
LDREnhancement.cpp \
main.cpp \
utils.cpp \
imgProcessing_arm.S \
imgProcess_neon.cpp.neon \
CLAHE.cpp.neon
LOCAL_SHARED_LIBRARIES := \
opencv_java
LOCAL_CFLAGS :=-O3 -D__cpusplus -g -mfloat-abi=softfp -mfpu=neon -march=armv7-a -mtune=cortex-a15
TARGET_ARCH_ABI :=armeabi-v7a
LOCAL_ARM_MODE := arm
LOCAL_ARM_NEON := true
LOCAL_C_INCLUDES := \
./include \
./include/opencv \
./include/opencv2 \
include $(BUILD_EXECUTABLE)
#3
汇编代码写在 imgProcessing_arm.S文件中,调用函数在LDREnhancement.cpp文件中
#4
没人解答啊,大神
#5
1. 首先你使用cpp,所以在你的cpp文件(LDREnhancement.cpp)中需要使用
extern "C" void YUV_to_HSV_neon( unsigned char * in_Y_arm,......);
2 如果還不能解決的話,你試試把彙編文件中的
.func YUV_to_HSV_neon
改成
.type YUV_to_HSV_neon, %function
extern "C" void YUV_to_HSV_neon( unsigned char * in_Y_arm,......);
2 如果還不能解決的話,你試試把彙編文件中的
.func YUV_to_HSV_neon
改成
.type YUV_to_HSV_neon, %function
#6
順便說一下,兄弟你的結貼率太低了!!!
#7
哪有c文件,明明不都是cpp。那就得:
extern "C" void YUV_to_HSV_neon( unsigned char * in_Y_arm,......)
extern "C" void YUV_to_HSV_neon( unsigned char * in_Y_arm,......)
#1
makefile貼出來看看
#2
这是makefile:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := opencv_java
LOCAL_SRC_FILES := $(LOCAL_PATH)/libopencv_java.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := ldr_neon
LOCAL_SRC_FILES := \
ImgProcessing.cpp \
ColorSpace_Conversion.cpp \
LDREnhancement.cpp \
main.cpp \
utils.cpp \
imgProcessing_arm.S \
imgProcess_neon.cpp.neon \
CLAHE.cpp.neon
LOCAL_SHARED_LIBRARIES := \
opencv_java
LOCAL_CFLAGS :=-O3 -D__cpusplus -g -mfloat-abi=softfp -mfpu=neon -march=armv7-a -mtune=cortex-a15
TARGET_ARCH_ABI :=armeabi-v7a
LOCAL_ARM_MODE := arm
LOCAL_ARM_NEON := true
LOCAL_C_INCLUDES := \
./include \
./include/opencv \
./include/opencv2 \
include $(BUILD_EXECUTABLE)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := opencv_java
LOCAL_SRC_FILES := $(LOCAL_PATH)/libopencv_java.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := ldr_neon
LOCAL_SRC_FILES := \
ImgProcessing.cpp \
ColorSpace_Conversion.cpp \
LDREnhancement.cpp \
main.cpp \
utils.cpp \
imgProcessing_arm.S \
imgProcess_neon.cpp.neon \
CLAHE.cpp.neon
LOCAL_SHARED_LIBRARIES := \
opencv_java
LOCAL_CFLAGS :=-O3 -D__cpusplus -g -mfloat-abi=softfp -mfpu=neon -march=armv7-a -mtune=cortex-a15
TARGET_ARCH_ABI :=armeabi-v7a
LOCAL_ARM_MODE := arm
LOCAL_ARM_NEON := true
LOCAL_C_INCLUDES := \
./include \
./include/opencv \
./include/opencv2 \
include $(BUILD_EXECUTABLE)
#3
汇编代码写在 imgProcessing_arm.S文件中,调用函数在LDREnhancement.cpp文件中
#4
没人解答啊,大神
#5
1. 首先你使用cpp,所以在你的cpp文件(LDREnhancement.cpp)中需要使用
extern "C" void YUV_to_HSV_neon( unsigned char * in_Y_arm,......);
2 如果還不能解決的話,你試試把彙編文件中的
.func YUV_to_HSV_neon
改成
.type YUV_to_HSV_neon, %function
extern "C" void YUV_to_HSV_neon( unsigned char * in_Y_arm,......);
2 如果還不能解決的話,你試試把彙編文件中的
.func YUV_to_HSV_neon
改成
.type YUV_to_HSV_neon, %function
#6
順便說一下,兄弟你的結貼率太低了!!!
#7
哪有c文件,明明不都是cpp。那就得:
extern "C" void YUV_to_HSV_neon( unsigned char * in_Y_arm,......)
extern "C" void YUV_to_HSV_neon( unsigned char * in_Y_arm,......)