undefined reference to `cv::CascadeClassifier::CascadeClassifier()'
时间: 2024-05-10 13:19:59 浏览: 124
This error message usually occurs when you are trying to use the cv::CascadeClassifier class in your code, but have not properly included the necessary OpenCV libraries or have not linked to them correctly.
To fix this error, you need to make sure that you have included the following header file at the top of your code:
```cpp
#include <opencv2/objdetect/objdetect.hpp>
```
Additionally, you need to link to the OpenCV libraries when compiling your code. This can be done by adding the following flag to your compile command:
```
-lopencv_objdetect
```
If you are using an IDE like Visual Studio or Xcode, you should be able to add the necessary libraries to your project settings.
Once you have properly included the necessary libraries and linked to them correctly, the error should be resolved and you should be able to use the cv::CascadeClassifier class in your code without any issues.
阅读全文