hpe项目编译问题解决

编译错误

compileDebugJavaWithJavac报错

askExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'

1.使用gradle命令,首先配置JAVA_HOME环境变量。配置为Android Studio\jre
2.hpe项目根目录下使用

gradlew compileDebugJavaWithJavac

进行编译,发现

错误: Could not find the AndroidManifest.xml file

Mat转IplImage不支持

解决:换opencv版本为3.1.0

链接出错

C:/Libs/OpenCV-android-sdk-310/sdk/native/jni/../libs/armeabi-v7a/libopencv_calib3d.a(fundam.cpp.o):fundam.cpp:function _GLOBAL__sub_I_fundam.cpp: error: undefined reference to 'std::ios_base::Init::Init()'
C:/Libs/OpenCV-android-sdk-310/sdk/native/jni/../libs/armeabi-v7a/libopencv_calib3d.a(fundam.cpp.o):fundam.cpp:function _GLOBAL__sub_I_fundam.cpp: error: undefined reference to 'std::ios_base::Init::~Init()'

解决:在android.mk中加入 LOCAL_ALLOW_UNDEFINED_SYMBOLS := true

加载so失败

一直提示一些std库的类型定义找不到,是连接问题,但是网上找不到有效的参考。网上编译dlib较多的方法是cmake,索性放弃原作者的android.mk,上cmake。

Gradle DSL method not found: ‘cppFlags()’

不在gradle里引用cppFlags。改为在cmakelist里

set(CXX_FLAGS
        -std=c++11
        -frtti
        -fexceptio
        )

Gradle DSL method not found: ‘abiFilters()’

在defaultConfig {…}平级定义

    externalNativeBuild{
        cmake {
            path "CMakeLists.txt"
        }
    }

在defaultConfig {…}中定义

        externalNativeBuild{
            cmake {
                abiFilters "armeabi-v7a", "arm64-v8a"
            }
        }

连接选项在cmakelist里的添加

# link all together
target_link_libraries( # Specifies the target library.
                     head_pose_det
                     # 添加库
                     android log
                     libopencv_java3
                     jnigraphics
                     log
                     z
                     m
                     dl
                     # Links the target library to the log library
                     # included in the NDK.
                     ${log-lib} )
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值