Ask Your Question
0

using -l in g++ command line

asked 2020-03-22 10:06:16 -0600

andrei186 gravatar image

Is it correct to assume that for every opencv header included into the cpp file

#include <opencv2/xxx.hpp>

-lopencv_xxx needs to be added to g++ command line?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-03-23 10:40:05 -0600

juanmamdp gravatar image

updated 2020-03-23 10:43:27 -0600

Add this `pkg-config --libs --cflags opencv` (OpenCV 2.x and 3.x) or `pkg-config --libs --cflags opencv4` -std=c++11 (OpenCV 4.x) to your compilation line and you will have everything you need to compile.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-03-22 10:06:16 -0600

Seen: 373 times

Last updated: Mar 23 '20