当前位置:   article > 正文

opencv2/core/utility.hpp(718): error C2039: “recursive_mutex“: 不是 “std“ 的成员_error: c2039: "recursive": 不是

error: c2039: "recursive": 不是
  1. [main] 正在生成文件夹: threadSeg_Yolo_RT_vscode clean
  2. [build] 正在启动生成
  3. [proc] 执行命令: D:\program\CMake\bin\cmake.EXE --build F:/code/projects/threadSeg_Yolo_RT_vscode/build/x64-debug --parallel 6 --target clean
  4. [build] -- GLOB mismatch!
  5. [build] -- GLOB mismatch!
  6. [build] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
  7. [build] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
  8. [build] -- Qt6 library is found!
  9. [build] -- OpenCV library found at D:/program/opencv/build/include
  10. [build] -- Eigen3 library is found!
  11. [build] -- CUDA library is found!
  12. [build] -- Found TensorRT headers at D:/program/TensorRT-8.5.1.7/include
  13. [build] -- Find TensorRT libs at D:/program/TensorRT-8.5.1.7/lib/nvinfer.lib;D:/program/TensorRT-8.5.1.7/lib/nvinfer_plugin.lib;D:/program/TensorRT-8.5.1.7/lib/nvonnxparser.lib;D:/program/TensorRT-8.5.1.7/lib/nvparsers.lib
  14. [build] -- Configuring done (5.4s)
  15. [build] -- Generating done (0.4s)
  16. [build] -- Build files have been written to: F:/code/projects/threadSeg_Yolo_RT_vscode/build/x64-debug
  17. [build] [0/2] Re-checking globbed directories...
  18. [build] [1/2] Re-running CMake...
  19. [build] [0/2] Re-checking globbed directories...
  20. [build] [1/2] Cleaning additional files...
  21. [build] [2/2] Cleaning all built files...
  22. [build] Cleaning... 9 files.
  23. [driver] 生成完毕: 00:00:07.009
  24. [build] 生成已完成,退出代码为 0
  25. [main] 正在生成文件夹: threadSeg_Yolo_RT_vscode
  26. [build] 正在启动生成
  27. [proc] 执行命令: D:\program\CMake\bin\cmake.EXE --build F:/code/projects/threadSeg_Yolo_RT_vscode/build/x64-debug --parallel 6 --target THREAD_YOLO_RT_VSCODE
  28. [build] -- GLOB mismatch!
  29. [build] -- GLOB mismatch!
  30. [build] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
  31. [build] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
  32. [build] -- Qt6 library is found!
  33. [build] -- OpenCV library found at D:/program/opencv/build/include
  34. [build] -- Eigen3 library is found!
  35. [build] -- CUDA library is found!
  36. [build] -- Found TensorRT headers at D:/program/TensorRT-8.5.1.7/include
  37. [build] -- Find TensorRT libs at D:/program/TensorRT-8.5.1.7/lib/nvinfer.lib;D:/program/TensorRT-8.5.1.7/lib/nvinfer_plugin.lib;D:/program/TensorRT-8.5.1.7/lib/nvonnxparser.lib;D:/program/TensorRT-8.5.1.7/lib/nvparsers.lib
  38. [build] -- Configuring done (5.5s)
  39. [build] -- Generating done (0.3s)
  40. [build] -- Build files have been written to: F:/code/projects/threadSeg_Yolo_RT_vscode/build/x64-debug
  41. [build] [0/2] Re-checking globbed directories...
  42. [build] [1/2] Re-running CMake...
  43. [build] [0/2] Re-checking globbed directories...
  44. [build] [1/10] Running qmlimportscanner for THREAD_YOLO_RT_VSCODE
  45. [build] [2/10] Automatic MOC and UIC for target THREAD_YOLO_RT_VSCODE
  46. [build] [3/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\util.cpp.obj
  47. [build] D:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\include\numeric(35): warning C4244: “=”: 从“_Ty”转换到“_Ty”,可能丢失数据
  48. [build] with
  49. [build] [
  50. [build] _Ty=int64_t
  51. [build] ]
  52. [build] and
  53. [build] [
  54. [build] _Ty=int
  55. [build] ]
  56. [build] D:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\include\numeric(35): note: 模板实例化上下文(最早的实例化上下文)为
  57. [build] F:\code\projects\threadSeg_Yolo_RT_vscode\src\util.cpp(34): note: 查看对正在编译的函数 模板 实例化“_Ty std::accumulate<const int32_t*,int,std::multiplies<int64_t>>(const _InIt,const _InIt,_Ty,_Fn)”的引用
  58. [build] with
  59. [build] [
  60. [build] _Ty=int,
  61. [build] _InIt=const int32_t *,
  62. [build] _Fn=std::multiplies<int64_t>
  63. [build] ]
  64. [build] [4/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\process.cpp.obj
  65. [build] [5/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\qswitchbutton.cpp.obj
  66. [build] [6/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\infer.cpp.obj
  67. [build] [7/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\THREAD_YOLO_RT_VSCODE_autogen\mocs_compilation.cpp.obj
  68. [build] FAILED: CMakeFiles/THREAD_YOLO_RT_VSCODE.dir/THREAD_YOLO_RT_VSCODE_autogen/mocs_compilation.cpp.obj
  69. [build] "D:\Program Files\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1440~1.338\bin\Hostx64\x64\cl.exe" /nologo /TP -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_OPENGLWIDGETS_LIB -DQT_OPENGL_LIB -DQT_QMLBUILTINS_LIB -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -DQT_WIDGETS_LIB -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -ID:\program\TensorRT-8.5.1.7\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -ID:\program\Eigen3\include\eigen3 -IF:\code\projects\threadSeg_Yolo_RT_vscode\include -external:ID:\program\opencv\build\include -external:IF:\code\projects\threadSeg_Yolo_RT_vscode\build\x64-debug\THREAD_YOLO_RT_VSCODE_autogen\include -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtCore -external:ID:\program\Qt\6.8.0\msvc2022_64\include -external:ID:\program\Qt\6.8.0\msvc2022_64\mkspecs\win32-msvc -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtWidgets -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtGui -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtOpenGLWidgets -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtOpenGL -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtQml -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtQmlIntegration -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtQmlBuiltins -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtNetwork -external:W0 /DWIN32 /D_WINDOWS /EHsc /Ob0 /Od /RTC1 -std:c++20 -MDd -Zi -Zc:__cplusplus -permissive- -utf-8 /showIncludes /FoCMakeFiles\THREAD_YOLO_RT_VSCODE.dir\THREAD_YOLO_RT_VSCODE_autogen\mocs_compilation.cpp.obj /FdCMakeFiles\THREAD_YOLO_RT_VSCODE.dir\ /FS -c F:\code\projects\threadSeg_Yolo_RT_vscode\build\x64-debug\THREAD_YOLO_RT_VSCODE_autogen\mocs_compilation.cpp
  70. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(718): error C2039: "recursive_mutex": 不是 "std" 的成员
  71. [build] D:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\include\complex(62): note: 参见“std”的声明
  72. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(718): error C2146: 语法错误: 缺少“;”(在标识符“Mutex”的前面)
  73. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(719): error C2039: "lock_guard": 不是 "std" 的成员
  74. [build] D:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\include\complex(62): note: 参见“std”的声明
  75. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(719): error C7568: 假定的函数模板“lock_guard”后面缺少参数列表
  76. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(719): error C2062: 意外的类型“unknown-type”
  77. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(192): error C2187: 语法错误: 此处出现意外的“cv”
  78. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(189): note: 此诊断出现在编译器生成的函数“cv::Ptr<cvflann::Heap<T>> cvflann::Heap<T>::getPooledInstance(const HashableT &,const int,int)”中
  79. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(192): note: 模板实例化上下文(最早的实例化上下文)为
  80. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(63): note: 在编译类模板“cvflann::Heap”时
  81. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(192): error C2065: “mutex”: 未声明的标识符
  82. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(189): note: 此诊断出现在编译器生成的函数“cv::Ptr<cvflann::Heap<T>> cvflann::Heap<T>::getPooledInstance(const HashableT &,const int,int)”中
  83. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(193): error C2065: “mutex”: 未声明的标识符
  84. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(189): note: 此诊断出现在编译器生成的函数“cv::Ptr<cvflann::Heap<T>> cvflann::Heap<T>::getPooledInstance(const HashableT &,const int,int)”中
  85. [build] [8/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\yolowindow.cpp.obj
  86. [build] FAILED: CMakeFiles/THREAD_YOLO_RT_VSCODE.dir/src/yolowindow.cpp.obj
  87. [build] "D:\Program Files\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1440~1.338\bin\Hostx64\x64\cl.exe" /nologo /TP -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_OPENGLWIDGETS_LIB -DQT_OPENGL_LIB -DQT_QMLBUILTINS_LIB -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -DQT_WIDGETS_LIB -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -ID:\program\TensorRT-8.5.1.7\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -ID:\program\Eigen3\include\eigen3 -IF:\code\projects\threadSeg_Yolo_RT_vscode\include -external:ID:\program\opencv\build\include -external:IF:\code\projects\threadSeg_Yolo_RT_vscode\build\x64-debug\THREAD_YOLO_RT_VSCODE_autogen\include -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtCore -external:ID:\program\Qt\6.8.0\msvc2022_64\include -external:ID:\program\Qt\6.8.0\msvc2022_64\mkspecs\win32-msvc -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtWidgets -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtGui -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtOpenGLWidgets -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtOpenGL -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtQml -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtQmlIntegration -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtQmlBuiltins -external:ID:\program\Qt\6.8.0\msvc2022_64\include\QtNetwork -external:W0 /DWIN32 /D_WINDOWS /EHsc /Ob0 /Od /RTC1 -std:c++20 -MDd -Zi -Zc:__cplusplus -permissive- -utf-8 /showIncludes /FoCMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\yolowindow.cpp.obj /FdCMakeFiles\THREAD_YOLO_RT_VSCODE.dir\ /FS -c F:\code\projects\threadSeg_Yolo_RT_vscode\src\yolowindow.cpp
  88. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(718): error C2039: "recursive_mutex": 不是 "std" 的成员
  89. [build] D:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\include\complex(62): note: 参见“std”的声明
  90. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(718): error C2146: 语法错误: 缺少“;”(在标识符“Mutex”的前面)
  91. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(719): error C2039: "lock_guard": 不是 "std" 的成员
  92. [build] D:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\include\complex(62): note: 参见“std”的声明
  93. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(719): error C7568: 假定的函数模板“lock_guard”后面缺少参数列表
  94. [build] D:\program\opencv\build\include\opencv2/core/utility.hpp(719): error C2062: 意外的类型“unknown-type”
  95. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(192): error C2187: 语法错误: 此处出现意外的“cv”
  96. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(189): note: 此诊断出现在编译器生成的函数“cv::Ptr<cvflann::Heap<T>> cvflann::Heap<T>::getPooledInstance(const HashableT &,const int,int)”中
  97. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(192): note: 模板实例化上下文(最早的实例化上下文)为
  98. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(63): note: 在编译类模板“cvflann::Heap”时
  99. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(192): error C2065: “mutex”: 未声明的标识符
  100. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(189): note: 此诊断出现在编译器生成的函数“cv::Ptr<cvflann::Heap<T>> cvflann::Heap<T>::getPooledInstance(const HashableT &,const int,int)”中
  101. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(193): error C2065: “mutex”: 未声明的标识符
  102. [build] D:\program\opencv\build\include\opencv2\flann\heap.h(189): note: 此诊断出现在编译器生成的函数“cv::Ptr<cvflann::Heap<T>> cvflann::Heap<T>::getPooledInstance(const HashableT &,const int,int)”中
  103. [build] [9/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\main.cpp.obj
  104. [build] ninja: build stopped: subcommand failed.
  105. [proc] 命令“D:\program\CMake\bin\cmake.EXE --build F:/code/projects/threadSeg_Yolo_RT_vscode/build/x64-debug --parallel 6 --target THREAD_YOLO_RT_VSCODE”已退出,代码为 1
  106. [driver] 生成完毕: 00:00:32.293
  107. [build] 生成已完成,退出代码为 1

调试过程

这个报错是我在头文件中添加 #include <QThread> 时出现的。这个报错之前遇到过,没有解决,更改程序规避掉了。但是这次代码不好修改,尝试解决这个报错。

首先,根据 "error C2039: "recursive_mutex": 不是 "std" 的成员"报错,搜索解决方法。

有的解答是说MINGW的编译器可能不支持多线程,需要切换到POSIX版本。但用的MSVC的编译器,并且新建一个工程尝试添加 <QThread>头文件并调试,并无报错。

接着,怀疑是OPENCV框架没有编译好,但是opencv是下的官网最新版的编译好的文件,不太可能存在编译问题。尝试修改OPENCV的源文件和编译配置文件,都无法解决。

于是,尝试编译MINGW版的OPENCV,但出现更多报错,包括CUDA无法查到,FFPEG相关库无法下载等,这些报错一时无法解决。但是本地已经有一个mingw的opencv4.1.1库,这个是别人编译好的在本地测试有效。尝试基于此库新建工程测试,将thread.h,mutex.h等头文件包括在内进行测试,发现多线程能够正常工作,并且mingw的编译器不是posix好像也没关系。

在接着在网上搜索答案,包括在github,opencv论坛上搜索相似保存,所提解决方法,都没解决这个报错。

最后的解决方法,啼笑皆非:

  1. #ifndef YOLOWINDOW_H
  2. #define YOLOWINDOW_H
  3. #include <QMainWindow>
  4. #include <QOpenGLWidget>
  5. #include <QFileDialog>
  6. #include <QListView>
  7. #include <QTreeView>
  8. #include <QDialogButtonBox>
  9. #include <QMessageBox>
  10. #include <QImage>
  11. #include "qswitchbutton.h"
  12. #include "infer.h"

这样的头文件能够正常编译运行,但是我需要用到多线程。于是添加头文件QThread:

  1. #ifndef YOLOWINDOW_H
  2. #define YOLOWINDOW_H
  3. #include <QMainWindow>
  4. #include <QOpenGLWidget>
  5. #include <QFileDialog>
  6. #include <QListView>
  7. #include <QTreeView>
  8. #include <QDialogButtonBox>
  9. #include <QMessageBox>
  10. #include <QImage>
  11. #include <QThread>
  12. #include "qswitchbutton.h"
  13. #include "infer.h"

这就出现最开始的报错。最后试着调整头文件位置:

  1. #ifndef YOLOWINDOW_H
  2. #define YOLOWINDOW_H
  3. #include "qswitchbutton.h"
  4. #include "infer.h"
  5. #include <QMainWindow>
  6. #include <QOpenGLWidget>
  7. #include <QFileDialog>
  8. #include <QListView>
  9. #include <QTreeView>
  10. #include <QDialogButtonBox>
  11. #include <QMessageBox>
  12. #include <QImage>
  13. #include <QThread>

这样就能够顺利编译:

  1. [main] 正在生成文件夹: threadSeg_Yolo_RT_vscode clean
  2. [build] 正在启动生成
  3. [proc] 执行命令: D:\program\CMake\bin\cmake.EXE --build F:/code/projects/threadSeg_Yolo_RT_vscode/build/x64-debug --parallel 6 --target clean
  4. [build] -- GLOB mismatch!
  5. [build] -- GLOB mismatch!
  6. [build] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
  7. [build] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
  8. [build] -- Qt6 library is found!
  9. [build] -- OpenCV library found at D:/program/opencv/build/include
  10. [build] -- Eigen3 library is found!
  11. [build] -- CUDA library is found!
  12. [build] -- Found TensorRT headers at D:/program/TensorRT-8.5.1.7/include
  13. [build] -- Find TensorRT libs at D:/program/TensorRT-8.5.1.7/lib/nvinfer.lib;D:/program/TensorRT-8.5.1.7/lib/nvinfer_plugin.lib;D:/program/TensorRT-8.5.1.7/lib/nvonnxparser.lib;D:/program/TensorRT-8.5.1.7/lib/nvparsers.lib
  14. [build] -- Configuring done (7.4s)
  15. [build] -- Generating done (0.4s)
  16. [build] -- Build files have been written to: F:/code/projects/threadSeg_Yolo_RT_vscode/build/x64-debug
  17. [build] [0/2] Re-checking globbed directories...
  18. [build] [1/2] Re-running CMake...
  19. [build] [0/2] Re-checking globbed directories...
  20. [build] [1/2] Cleaning additional files...
  21. [build] [2/2] Cleaning all built files...
  22. [build] Cleaning... 6 files.
  23. [driver] 生成完毕: 00:00:09.452
  24. [build] 生成已完成,退出代码为 0
  25. [main] 正在生成文件夹: threadSeg_Yolo_RT_vscode
  26. [build] 正在启动生成
  27. [proc] 执行命令: D:\program\CMake\bin\cmake.EXE --build F:/code/projects/threadSeg_Yolo_RT_vscode/build/x64-debug --parallel 6 --target THREAD_YOLO_RT_VSCODE
  28. [build] -- GLOB mismatch!
  29. [build] -- GLOB mismatch!
  30. [build] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
  31. [build] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
  32. [build] -- Qt6 library is found!
  33. [build] -- OpenCV library found at D:/program/opencv/build/include
  34. [build] -- Eigen3 library is found!
  35. [build] -- CUDA library is found!
  36. [build] -- Found TensorRT headers at D:/program/TensorRT-8.5.1.7/include
  37. [build] -- Find TensorRT libs at D:/program/TensorRT-8.5.1.7/lib/nvinfer.lib;D:/program/TensorRT-8.5.1.7/lib/nvinfer_plugin.lib;D:/program/TensorRT-8.5.1.7/lib/nvonnxparser.lib;D:/program/TensorRT-8.5.1.7/lib/nvparsers.lib
  38. [build] -- Configuring done (7.5s)
  39. [build] -- Generating done (0.4s)
  40. [build] -- Build files have been written to: F:/code/projects/threadSeg_Yolo_RT_vscode/build/x64-debug
  41. [build] [0/2] Re-checking globbed directories...
  42. [build] [1/2] Re-running CMake...
  43. [build] [0/2] Re-checking globbed directories...
  44. [build] [1/10] Running qmlimportscanner for THREAD_YOLO_RT_VSCODE
  45. [build] [2/10] Automatic MOC and UIC for target THREAD_YOLO_RT_VSCODE
  46. [build] [3/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\util.cpp.obj
  47. [build] D:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\include\numeric(35): warning C4244: “=”: 从“_Ty”转换到“_Ty”,可能丢失数据
  48. [build] with
  49. [build] [
  50. [build] _Ty=int64_t
  51. [build] ]
  52. [build] and
  53. [build] [
  54. [build] _Ty=int
  55. [build] ]
  56. [build] D:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\include\numeric(35): note: 模板实例化上下文(最早的实例化上下文)为
  57. [build] F:\code\projects\threadSeg_Yolo_RT_vscode\src\util.cpp(34): note: 查看对正在编译的函数 模板 实例化“_Ty std::accumulate<const int32_t*,int,std::multiplies<int64_t>>(const _InIt,const _InIt,_Ty,_Fn)”的引用
  58. [build] with
  59. [build] [
  60. [build] _Ty=int,
  61. [build] _InIt=const int32_t *,
  62. [build] _Fn=std::multiplies<int64_t>
  63. [build] ]
  64. [build] [4/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\qswitchbutton.cpp.obj
  65. [build] [5/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\process.cpp.obj
  66. [build] [6/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\infer.cpp.obj
  67. [build] [7/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\THREAD_YOLO_RT_VSCODE_autogen\mocs_compilation.cpp.obj
  68. [build] [8/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\main.cpp.obj
  69. [build] [9/10] Building CXX object CMakeFiles\THREAD_YOLO_RT_VSCODE.dir\src\yolowindow.cpp.obj
  70. [build] [10/10] Linking CXX executable THREAD_YOLO_RT_VSCODE.exe
  71. [driver] 生成完毕: 00:00:42.618
  72. [build] 生成已完成,退出代码为 0

具体原因不知道是为什么,可能是QThread放置顺序影响“infer.h”这个文件的程序。这种情况以前好像遇到过,记得不太清,试了一下,这个报错就解决了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/954836
推荐阅读
相关标签
  

闽ICP备14008679号