当前位置:网站首页>darkent2ncnn出错
darkent2ncnn出错
2022-06-25 22:13:00 【所向披靡的张大刀】
出错
gcc obj/convert_verify.o libdarknet2ncnn.a -o convert_verify -L ncnn/build/install/lib/ -L . -L darknet -ldarknet -lncnn -ldarknet2ncnn -lm -pthread -fopenmp pkg-config --libs opencv -lstdc++ -I include -I ncnn/build/install/include/ -I darknet/include/ -I src -I ncnn/src/ pkg-config --cflags opencv -Wno-unused-result -Wfatal-errors -fPIC -Ofast
obj/convert_verify.o: In function `test_network(char*, char*, char*, char*, char*)’:
convert_verify.cpp:(.text+0x102): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)’
convert_verify.cpp:(.text+0x5c6): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)’
convert_verify.cpp:(.text+0x605): undefined reference to `cv::imshow(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, cv::_InputArray const&)’
collect2: error: ld returned 1 exit status
Makefile:43: recipe for target ‘convert_verify’ failed
make: *** [convert_verify] Error 1
错误如上。
原因
是因为 c++11 的问题。如下用红色表示:
undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)’
修改
g++版本
[email protected]:~/zhouyi/darknet2ncnn-master# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu 7.5.0-3ubuntu1~18.04’ --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
Ubuntu版本
Ubuntu 18.04
解决方法
强制指定使用 c++11 的标准进行编译。通过修改 Makefile 来实现。在 darknet2ncnn 的 Makefile 第 23 行,增加使用 c++11 来编译。如下所示:
LDFLAGS+= -std=c++11 pkg-config --libs opencv -lstdc++
注意 c++11 必须小写。
保存 Makefile 文件,重新编译。问题解决。
边栏推荐
- PCB生产为什么要做拼板和板边
- smt贴片加工行业常见术语及知识汇总
- STEP7 master station and remote i/o networking_ Old bear passing by_ Sina blog
- [转载]RSLOGIX 5000实例教程
- 【微信公众号H5】 生成带参数进入公众号关注页的二维码 监听用户关注公众号事件 自定义菜单栏 (服务端)
- About the solution to prompt modulenotfounderror: no module named'pymongo 'when running the scratch project
- My blog is 2 years old and 167 days old today. I received the pioneer blogger Badge_ Old bear passing by_ Sina blog
- Transformation of communication protocol between Siemens S7-200PLC and Danfoss inverter_ Old bear passing by_ Sina blog
- 10.2.3、Kylin_kylin的使用,维度必选
- On the use of bisection and double pointer
猜你喜欢
![Bit compressor [Blue Bridge Cup training]](/img/d5/231d20bf4104cc2619b2a4f19b605c.png)
Bit compressor [Blue Bridge Cup training]

DHCP review

Studio5k v28安装及破解_过路老熊_新浪博客
![Bit Compressor [蓝桥杯题目训练]](/img/d5/231d20bf4104cc2619b2a4f19b605c.png)
Bit Compressor [蓝桥杯题目训练]

About Simple Data Visualization

11.1.1、flink概述_flink概述

Redis之跳跃表

Reading notes on how to connect the network - hubs, routers and routers (III)

6. common instructions (upper) v-cloak, v-once, v-pre

Unable to start debugging. Unexpected GDB output from command “-environment -cd xxx“ No such file or
随机推荐
Studio5k V28 installation and cracking_ Old bear passing by_ Sina blog
Talk about singleton mode!
Topic36——53. Maximum subarray and
详细讲解局部变量、全局变量、静态变量三种类型
SSM integrated learning notes (mainly ideas)
Sentinel of redis
redis之详解
Efficacy of kiwi fruit enzyme_ Old bear passing by_ Sina blog
Lazy people teach you to use kiwi fruit to lose 16 kg in a month_ Old bear passing by_ Sina blog
dbca静默安装及建库
EasyConnect连接后显示未分配虚拟地址
Redis memory elimination mechanism
Thrift getting started
文献调研(三):数据驱动的建筑能耗预测模型综述
Literature research (I): hourly energy consumption prediction of office buildings based on integrated learning and energy consumption pattern classification
博图软件中多重背景块的建立_过路老熊_新浪博客
Recherche documentaire (3): examen des modèles de prévision de la consommation d'énergie des bâtiments fondés sur les données
Network connection verification
MongoDB的一些基础用法
keil编译运行错误,缺少error:#5:#includecore_cm3.h_过路老熊_新浪博客