Comments (1)
您好,请问您解决这个问题了吗?
您好,我直接使用本项目提供的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请问是哪里出了问题呢?
您好,请问您解决这个问题了嘛
from opencv341-mingw-build-x64.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencv341-mingw-build-x64.