[Solved] Compile the program error: undefined reference to `cv::dnn::dnn4_v20210301::Net::~Net()‘

Reason: the cmakelists.txt file does not specify the DNN module, so the statement

find_package(OpenCV 4 REQUIRED opencv_core opencv_imgproc opencv_highgui opencv_calib3d opencv_videoio opencv_imgcodecs )

To be amended as follows:

find_package(OpenCV 4 REQUIRED)

It can be compiled.


Read More: