Ask Your Question

using -l in g++ command line

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

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

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

juanmamdp gravatar image

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

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


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

Seen: 148 times

Last updated: Mar 23 '20