gpt4 book ai didi

android - 静态链接OpenCV 2.4.3.2

转载 作者:行者123 更新时间:2023-12-02 17:53:07 30 4
gpt4 key购买 nike

我想将OpenCV(2.4.3.2)静态链接到我的项目。现在我的Android.mk看起来像这样

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on

include /Users/jamiematthews/Documents/Android-Projects/OpenCV-2.4.3-android-sdk/sdk/native/jni/OpenCV.mk

LOCAL_MODULE := jni_part
LOCAL_SRC_FILES := jni_part.cpp
LOCAL_LDLIBS += -llog -ldl
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
include $(BUILD_SHARED_LIBRARY)

引发错误:
Android NDK: ERROR:/Users/jamiematthews/Documents/workspace/AuthentiGuard/jni/Android.mk:on: LOCAL_SRC_FILES points to a missing file    
/Users/jamiematthews/Documents/android-ndk-r8d/build/core/prebuilt-library.mk:43: *** Android NDK: Aborting . Stop.
Android NDK: Check that /Users/jamiematthews/Documents/Android-Projects/OpenCV-2.4.3-android-sdk/sdk/native/jni/../libs/mips/libon.so exists or that its path is correct

有人知道“LOCAL_SRC_FILES指向丢失的文件”是什么意思吗?

PS,如果我删除线
OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on

它编译正常,但是我不能静态链接

最佳答案

找到了解决方案。信不信由你,这是Application.mk的问题,而不是Android.mk的问题。我已经设定

APP_ABI := all

以前,甚至没有考虑过它可能会静态影响此构建过程。我最终将其更改为
APP_ABI := armeabi-v7a

现在,一切正常。请注意,我最终不需要OPENCV_CAMERA_MODULES:= on,我相信仅当您从JNI调用摄像机时,我才不需要

关于android - 静态链接OpenCV 2.4.3.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14859659/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com