g++编译Opencv

You need to properly include the headers -I (capital i) and libraries -l (lowercase L).

On the newest OpenCV versions you should do:

#include <cv.h>
#include <highgui.h>

And then try to compile it with:

g++ m.cpp -o app `pkg-config --cflags --libs opencv`

Note: if you execute only pkg-config --cflags --libs opencv in the command line you will see the paths and libraries you need to include in the g++ command line.

ref: https://stackoverflow.com/questions/9094941/compiling-opencv-in-c

发布了26 篇原创文章 · 获赞 0 · 访问量 1083

猜你喜欢

转载自blog.csdn.net/qq_41212157/article/details/100703833