如何在Windows 10中编译和运行此OpenCV C ++代码?

时间:2016-06-08 19:15:46

标签: c++ opencv compilation makefile mingw

我很难将这个示例项目放在我的Windows 10笔记本电脑上:

视频:https://www.youtube.com/watch?v=-ZNYoL8rzPY 代码:http://cvlab.epfl.ch/files/content/sites/cvlab2/files/software/brief/BRI EF_demo-0.5.zip

我有适用于Windows的OpenCV 3,我正在尝试使用MinGW和修改后的Makefile来实现它:

CC = g++
CFLAGS = -g -Wall -DHAVE_INLINE -msse4.2 -O3

SRCS = main.cpp BRIEF.cpp
PROG = BRIEF

OPENCV = -I"C/opencv_3/build/include" -L"C/opencv_3/build/x64/vc12/lib" -lopencv_core243 -lopencv_highgui243

$(PROG) : $(SRCS)
    $(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(OPENCV)

当我运行“make”(通过MinGW)时,我得到以下内容:

C:\MinGW\bin\mingw32-make.exe
g++ -g -Wall -DHAVE_INLINE -msse4.2 -O3 -o BRIEF main.cpp BRIEF.cpp -I"C/opencv_3/build/include" -L"C/opencv_3/build/x64/vc12/lib" -lopencv_core243 -lopencv_highgui243
In file included from main.cpp:26:0:
BRIEF.h:31:23: fatal error: opencv/cv.h: No such file or directory
 #include <opencv/cv.h>
                       ^
compilation terminated.
In file included from BRIEF.cpp:26:0:
BRIEF.h:31:23: fatal error: opencv/cv.h: No such file or directory
 #include <opencv/cv.h>
                       ^
compilation terminated.
Makefile:10: recipe for target 'BRIEF' failed
mingw32-make: *** [BRIEF] Error 1

这是我尝试过的。我对几乎任何允许我在Windows上运行OpenCV C ++的解决方案持开放态度,尤其是这个项目。我不介意下载其他/旧版本的OpenCV。谢谢你的帮助,这些东西总是令人沮丧。

编辑 -

文件夹结构:

 Directory of C:\opencv_3\build\include

06/08/2016  01:45 PM    <DIR>          .
06/08/2016  01:45 PM    <DIR>          ..
06/08/2016  01:45 PM    <DIR>          opencv
06/08/2016  01:45 PM    <DIR>          opencv2

0 个答案:

没有答案