undefined reference to `cv::face::FisherFaceRecognizer::create'
时间: 2023-09-15 16:16:37 浏览: 92
高性能Javascript:高效的数据访问
This error message typically occurs when the linker is unable to find the implementation of the `cv::face::FisherFaceRecognizer::create` function.
To resolve this issue, you can try the following steps:
1. Make sure that you have included the necessary headers in your code. You should include the following header files:
```
#include <opencv2/face.hpp>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
```
2. Check that you have linked the necessary libraries. You should link against the following libraries:
```
-lopencv_core
-lopencv_face
-lopencv_highgui
```
3. Confirm that you have the correct version of OpenCV installed. The `FisherFaceRecognizer` class is only available in OpenCV version 3.0 and above.
4. If you are using CMake, make sure that you have added the necessary libraries to your `CMakeLists.txt` file. You can add the following lines to your `CMakeLists.txt` file:
```
find_package(OpenCV REQUIRED)
target_link_libraries(your_target_name ${OpenCV_LIBS})
```
By following these steps, you should be able to resolve the `undefined reference to cv::face::FisherFaceRecognizer::create` error.
阅读全文