zxxf18 / opencv341-mingw-build-x64 Goto Github PK
View Code? Open in Web Editor NEWCompiled OpenCV-3.4.1 for windows x64 with MinGW
Compiled OpenCV-3.4.1 for windows x64 with MinGW
cmake error
'thread' in namespace 'std' does not name a type
出现了这个问题,请问有什么解决方法吗?
您好,我直接使用本项目提供的OpenCV,
我在C盘新建opencv文件夹,里面有两个文件夹:
1、mingw-build:就是clone本项目后,重新命名的;
2、sources:我从OpenCV官网下载opencv-3.4.1.zip,解压后重新命名的。
这样就跟您的所有配置都相同了(存放位置、文件夹名等),而CMakeLists.txt如下:
cmake_minimum_required(VERSION 3.15)
project(Jovi_Pong_v1_0_0)
set(CMAKE_CXX_STANDARD 14)
set(OpenCV_DIR "C:/opencv/mingw-build")
add_executable(Jovi_Pong_v1_0_0 main.cpp)
FIND_PACKAGE(OpenCV REQUIRED)
IF (OpenCV_FOUND)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(Jovi_Pong_v1_0_0 ${OpenCV_LIBS})
ELSE (OpenCV_FOUND)
MESSAGE(FATAL_ERROR "OpenCV library not found")
ENDIF (OpenCV_FOUND)
接下来写最简单的测试程序:
#include <opencv2/core/core.hpp>
using namespace cv;
int main()
{
Mat img;
return 0;
}
报错信息如下:
CMakeFiles\Jovi_Pong_v1_0_0.dir/objects.a(main.cpp.obj): In function
ZN2cv3MatD1Ev': C:/opencv/sources/modules/core/include/opencv2/core/mat.inl.hpp:704: undefined reference to
cv::fastFree(void*)'
CMakeFiles\Jovi_Pong_v1_0_0.dir/objects.a(main.cpp.obj): In functionZN2cv3Mat7releaseEv': C:/opencv/sources/modules/core/include/opencv2/core/mat.inl.hpp:816: undefined reference to
cv::Mat::deallocate()'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [CMakeFiles\Jovi_Pong_v1_0_0.dir\build.make:151: Jovi_Pong_v1_0_0.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:75: CMakeFiles/Jovi_Pong_v1_0_0.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:82: CMakeFiles/Jovi_Pong_v1_0_0.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:117: Jovi_Pong_v1_0_0] Error 2
请问是哪里出了问题呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.