Closed WANGCHAO1996 closed 3 years ago
这是OpenCV的问题,你要不试试把原来用apt-get装的OpenCV库卸掉然后下载源码重新编译
------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" <notifications@github.com>; 发送时间: 2020年11月30日(星期一) 下午2:29 收件人: "Nebula4869/YOLOv5-LibTorch"<YOLOv5-LibTorch@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5)
[ 50%] Building CXX object CMakeFiles/YOLOv5LibTorch.dir/src/YOLOv5LibTorch.cpp.o [100%] Linking CXX executable ../bin/YOLOv5LibTorch CMakeFiles/YOLOv5LibTorch.dir/src/YOLOv5LibTorch.cpp.o:在函数‘main’中: YOLOv5LibTorch.cpp:(.text.startup+0x14b4):对‘cv::format(char const*, ...)’未定义的引用 YOLOv5LibTorch.cpp:(.text.startup+0x1587):对‘cv::putText(cv::InputOutputArray const&, std::string const&, cv::Point, int, double, cv::Scalar, int, int, bool)’未定义的引用 YOLOv5LibTorch.cpp:(.text.startup+0x19c3):对‘cv::putText(cv::InputOutputArray const&, std::string const&, cv::Point, int, double, cv::Scalar, int, int, bool)’未定义的引用 YOLOv5LibTorch.cpp:(.text.startup+0x1a3f):对‘cv::imshow(std::string const&, cv::_InputArray const&)’未定义的引用 collect2: error: ld returned 1 exit status CMakeFiles/YOLOv5LibTorch.dir/build.make:132: recipe for target '../bin/YOLOv5LibTorch' failed make[2]: [../bin/YOLOv5LibTorch] Error 1 CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/YOLOv5LibTorch.dir/all' failed make[1]: [CMakeFiles/YOLOv5LibTorch.dir/all] Error 2 Makefile:102: recipe for target 'all' failed make: *** [all] Error 2
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
我也是opencv3.2.0 也是版本问题吗
这是OpenCV的问题,你要不试试把原来用apt-get装的OpenCV库卸掉然后下载源码重新编译 … ------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" <notifications@github.com>; 发送时间: 2020年11月30日(星期一) 下午2:29 收件人: "Nebula4869/YOLOv5-LibTorch"<YOLOv5-LibTorch@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5) [ 50%] Building CXX object CMakeFiles/YOLOv5LibTorch.dir/src/YOLOv5LibTorch.cpp.o [100%] Linking CXX executable ../bin/YOLOv5LibTorch CMakeFiles/YOLOv5LibTorch.dir/src/YOLOv5LibTorch.cpp.o:在函数‘main’中: YOLOv5LibTorch.cpp:(.text.startup+0x14b4):对‘cv::format(char const*, ...)’未定义的引用 YOLOv5LibTorch.cpp:(.text.startup+0x1587):对‘cv::putText(cv::InputOutputArray const&, std::string const&, cv::Point, int, double, cv::Scalar, int, int, bool)’未定义的引用 YOLOv5LibTorch.cpp:(.text.startup+0x19c3):对‘cv::putText(cv::InputOutputArray const&, std::string const&, cv::Point, int, double, cv::Scalar, int, int, bool)’未定义的引用 YOLOv5LibTorch.cpp:(.text.startup+0x1a3f):对‘cv::imshow(std::string const&, cv::_InputArray const&)’未定义的引用 collect2: error: ld returned 1 exit status CMakeFiles/YOLOv5LibTorch.dir/build.make:132: recipe for target '../bin/YOLOv5LibTorch' failed make[2]: [../bin/YOLOv5LibTorch] Error 1 CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/YOLOv5LibTorch.dir/all' failed make[1]: [CMakeFiles/YOLOv5LibTorch.dir/all] Error 2 Makefile:102: recipe for target 'all' failed make: *** [all] Error 2 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
cmake_minimum_required(VERSION 3.0 FATAL_ERROR) project(YOLOv5LibTorch) SET(CMAKE_BUILD_TYPE Release) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set(OpenCV_DIR /usr/lib/x86_64-linux-gnu) find_package(OpenCV REQUIRED) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}") set(CMAKE_PREFIX_PATH /home/xx405/下载/libtorch-shared-with-deps-1.6.0+cu101/libtorch) find_package(Torch REQUIRED) add_executable(YOLOv5LibTorch src/YOLOv5LibTorch.cpp)
include_directories( ${PROJECT_SOURCE_DIR}/include ${OpenCV_INCLUDE_DIRS} )
target_link_libraries(YOLOv5LibTorch ${OpenCV_LIBS} ${TORCH_LIBRARIES}) set_property(TARGET YOLOv5LibTorch PROPERTY CXX_STANDARD 14) 这样设置路径对吗?
我也是3.2.0而且我按我README里写的流程来就没问题,但我同学按这个流程来和你出了同样的问题就很离谱,他最后就是把apt-get装的OpenCV卸掉然后下载源码重新编译就好了
------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" <notifications@github.com>; 发送时间: 2020年11月30日(星期一) 下午2:36 收件人: "Nebula4869/YOLOv5-LibTorch"<YOLOv5-LibTorch@noreply.github.com>; 抄送: "Nebula"<nebula4869@foxmail.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5)
我也是opencv3.2.0 也是版本问题吗
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
我也是3.2.0而且我按我README里写的流程来就没问题,但我同学按这个流程来和你出了同样的问题就很离谱,他最后就是把apt-get装的OpenCV卸掉然后下载源码重新编译就好了 … ------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" <notifications@github.com>; 发送时间: 2020年11月30日(星期一) 下午2:36 收件人: "Nebula4869/YOLOv5-LibTorch"<YOLOv5-LibTorch@noreply.github.com>; 抄送: "Nebula"<nebula4869@foxmail.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5) 我也是opencv3.2.0 也是版本问题吗 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
好的!我试试
我问了我同学他后来下的OpenCV是3.14.0版本的源码,虽然我觉得跟版本关系不大,就是OpenCV装的有问题
------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" <notifications@github.com>; 发送时间: 2020年11月30日(星期一) 下午2:42 收件人: "Nebula4869/YOLOv5-LibTorch"<YOLOv5-LibTorch@noreply.github.com>; 抄送: "Nebula"<nebula4869@foxmail.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5)
我也是3.2.0而且我按我README里写的流程来就没问题,但我同学按这个流程来和你出了同样的问题就很离谱,他最后就是把apt-get装的OpenCV卸掉然后下载源码重新编译就好了 … ------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" <notifications@github.com>; 发送时间: 2020年11月30日(星期一) 下午2:36 收件人: "Nebula4869/YOLOv5-LibTorch"<YOLOv5-LibTorch@noreply.github.com>; 抄送: "Nebula"<nebula4869@foxmail.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5) 我也是opencv3.2.0 也是版本问题吗 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
好的!我试试
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
我问了我同学他后来下的OpenCV是3.14.0版本的源码,虽然我觉得跟版本关系不大,就是OpenCV装的有问题 … ------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" <notifications@github.com>; 发送时间: 2020年11月30日(星期一) 下午2:42 收件人: "Nebula4869/YOLOv5-LibTorch"<YOLOv5-LibTorch@noreply.github.com>; 抄送: "Nebula"<nebula4869@foxmail.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5) 我也是3.2.0而且我按我README里写的流程来就没问题,但我同学按这个流程来和你出了同样的问题就很离谱,他最后就是把apt-get装的OpenCV卸掉然后下载源码重新编译就好了 … ------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" <notifications@github.com>; 发送时间: 2020年11月30日(星期一) 下午2:36 收件人: "Nebula4869/YOLOv5-LibTorch"<YOLOv5-LibTorch@noreply.github.com>; 抄送: "Nebula"<nebula4869@foxmail.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5) 我也是opencv3.2.0 也是版本问题吗 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. 好的!我试试 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe
我问了我同学他后来下的OpenCV是3.14.0版本的源码,虽然我觉得跟版本关系不大,就是OpenCV装的有问题 … ------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" [notifications@github.com](mailto:notifications@github.com); 发送时间: 2020年11月30日(星期一) 下午2:42 收件人: "Nebula4869/YOLOv5-LibTorch"[YOLOv5-LibTorch@noreply.github.com](mailto:YOLOv5-LibTorch@noreply.github.com); 抄送: "Nebula"[nebula4869@foxmail.com](mailto:nebula4869@foxmail.com);"Comment"[comment@noreply.github.com](mailto:comment@noreply.github.com); 主题: Re: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5) 我也是3.2.0而且我按我README里写的流程来就没问题,但我同学按这个流程来和你出了同样的问题就很离谱,他最后就是把apt-get装的OpenCV卸掉然后下载源码重新编译就好了 … ------------------ 原始邮件 ------------------ 发件人: "Nebula4869/YOLOv5-LibTorch" [notifications@github.com](mailto:notifications@github.com); 发送时间: 2020年11月30日(星期一) 下午2:36 收件人: "Nebula4869/YOLOv5-LibTorch"[YOLOv5-LibTorch@noreply.github.com](mailto:YOLOv5-LibTorch@noreply.github.com); 抄送: "Nebula"[nebula4869@foxmail.com](mailto:nebula4869@foxmail.com);"Comment"[comment@noreply.github.com](mailto:comment@noreply.github.com); 主题: Re: [Nebula4869/YOLOv5-LibTorch] make error ...how to solve it ? (#5) 我也是opencv3.2.0 也是版本问题吗 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. 好的!我试试 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe
我也是安装的4版本opencv 但是每次查版本都显示3.2.0 查了一下里面有3.2.0版本的一些文件 所以感觉有点混乱
[ 50%] Building CXX object CMakeFiles/YOLOv5LibTorch.dir/src/YOLOv5LibTorch.cpp.o [100%] Linking CXX executable ../bin/YOLOv5LibTorch CMakeFiles/YOLOv5LibTorch.dir/src/YOLOv5LibTorch.cpp.o:在函数‘main’中: YOLOv5LibTorch.cpp:(.text.startup+0x14b4):对‘cv::format(char const*, ...)’未定义的引用 YOLOv5LibTorch.cpp:(.text.startup+0x1587):对‘cv::putText(cv::InputOutputArray const&, std::string const&, cv::Point, int, double, cv::Scalar_, int, int, bool)’未定义的引用
YOLOv5LibTorch.cpp:(.text.startup+0x19c3):对‘cv::putText(cv::InputOutputArray const&, std::string const&, cv::Point, int, double, cv::Scalar_, int, int, bool)’未定义的引用
YOLOv5LibTorch.cpp:(.text.startup+0x1a3f):对‘cv::imshow(std::string const&, cv::_InputArray const&)’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/YOLOv5LibTorch.dir/build.make:132: recipe for target '../bin/YOLOv5LibTorch' failed
make[2]: [../bin/YOLOv5LibTorch] Error 1
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/YOLOv5LibTorch.dir/all' failed
make[1]: [CMakeFiles/YOLOv5LibTorch.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2