First time here? Check out the FAQ!
answered 2018-10-17 02:09:22 -0600
"undefined reference" means, the linker did not find something.
you have to add nessecary opencv libs, like
-lopencv_core -lopencv_imgcodecs -lopencv_highgui -lopencv_imgproc