Reputation: 127
I feel like this should be basic, but I can't find anything for it online. I downloaded OpenCV and can't figure out how to have my projects recognize it. When I try to include it with like
#include <opencv2/core/version.hpp>
I get the error:
"No such file or directory"
The only solution I've tried is to add /usr/include/opencv4/ to my PATH. Also, I am running ArchLinux if that is helpful to know.
Upvotes: 3
Views: 2068
Reputation: 13
if you have trouble with this
#include <opencv2/core/version.hpp>
You can find more detail information on "Googling".
what I have organized shown below:
include "opencv2/core/version.hpp"
instead of it.Upvotes: 1
Reputation: 127
So I ended up just moving the directory /usr/include/opencv4/opencv2 to /usr/include and that worked. Unless there are any ways to add directories to the list of directories that c++ checks when running the #include, this is the only way I've figured to solve it.
Upvotes: 1
Reputation: 3744
Try changing these three:
PATH=$PATH:/usr/bin
CPATH=$CPATH:/usr/include/opencv4
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64:/usr/lib
Upvotes: 0