NDK编译报错 undefined reference to 'vtable for


jni/FaceDetection/include/classifier.h:49: error: undefined reference to 'vtable for seeta::fd::SURFMLP'
D:/android/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: the vtable symbol may be undefined because the class is missing its key function
jni/FaceDetection/src/fust.cpp:272: error: undefined reference to 'vtable for seeta::fd::LABBoostModelReader'
D:/android/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: the vtable symbol may be undefined because the class is missing its key function
jni/FaceDetection/src/fust.cpp:272: error: undefined reference to 'vtable for seeta::fd::SURFMLPModelReader'
D:/android/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: the vtable symbol may be undefined because the class is missing its key function
jni/FaceDetection/src/fust.cpp:288: error: undefined reference to 'vtable for seeta::fd::LABBoostedClassifier'
D:/android/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: the vtable symbol may be undefined because the class is missing its key function
jni/FaceDetection/src/fust.cpp:304: error: undefined reference to 'vtable for seeta::fd::LABFeatureMap'
D:/android/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: the vtable symbol may be undefined because the class is missing its key function
jni/FaceDetection/src/fust.cpp:170: error: undefined reference to 'seeta::fd::NonMaximumSuppression(std::vector<seeta::FaceInfo, std::allocator<seeta::FaceInfo> >*, std::vector<seeta::FaceInfo, std::allocator<seeta::FaceInfo> >*, float)'
jni/FaceDetection/src/fust.cpp:241: error: undefined reference to 'seeta::fd::NonMaximumSuppression(std::vector<seeta::FaceInfo, std::allocator<seeta::FaceInfo> >*, std::vector<seeta::FaceInfo, std::allocator<seeta::FaceInfo> >*, float)'
collect2.exe: error: ld returned 1 exit status
make.exe: *** [obj/local/armeabi/libSeetafaceSo.so] Error 1

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


鸣谢:http://blog.sina.com.cn/s/blog_5be1061c0100ykim.html

undefined reference to func错误通常表示在链接时找不到函数的定义或实现。根据提供的引用资料,出现undefined reference to func错误的原因可能是以下几种情况之一: 1. 函数声明和函数定义不匹配:确保函数的声明和定义在头文件和源文件中的匹配,包括函数名、参数列表和返回类型。在你提供的引用中,func1在头文件B1.h中声明,而func2和func3在头文件B2.h中声明。请确保这些函数在相应的源文件中有正确的定义。 2. 缺少函数的实现:如果函数只是声明而没有实现,链接器将无法找到函数的定义。请确保在正确的源文件中提供了函数的实现。 3. 缺少需要链接的源文件:在编译时,链接器需要将所有的源文件一起链接为可执行文件。请确保在编译和链接时包含了所有需要的源文件。 解决此错误的方法包括: - 检查函数的声明和定义,确保它们匹配并位于正确的文件中。 - 确保提供了所有需要链接的源文件。 - 检查编译和链接命令是否正确,并且必要的库文件被正确链接。 希望这些信息对你有帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [解决使用NDK进行编译时出现undefined reference to function的问题](https://blog.csdn.net/llearner/article/details/70306806)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* ["undefined reference to" 问题汇总及解决方法](https://blog.csdn.net/weixin_34381666/article/details/89376726)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值