I found the problem. The issue was that the OpenCV folder path was incorrect. I wrote
<#include <opencv2/opencv.hpp>
but I should have written:
#include <your_opencv_module_path>
The error was simple, but it took me a long time to realize it. :(