Extra parent folder ruins path resolution for internal files in OpenCV? #48247
Replies: 1 comment 1 reply
-
|
The behavior you’re seeing is actually normal. Starting with OpenCV 4, the library’s headers are placed inside an extra |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
I am trying to modernize a legacy Visual Studio project which uses the opencv library. For this, I've decided to use vcpkg in order to better manage the dependency versions. Now, I've encountered what I would say "weird behaviour" but I'm not sure if this is specific to the opencv library.
Basically, when I install the opencv package, vcpkg copies the built library in this folder
.\vcpkg_installed\x86-windows\x86-windows\include\opencv2.4This means, when I try to include the files in my code I have to write them like this:
#include <opencv2.4/opencv2/opencv.hpp>If I try to build my project you can already imagine what happens. I get a compiler error telling me that inside opencv.hpp the following include
#include "opencv2/opencv_modules.hpp"couldn't be resolved.It makes sense since the folders opencv2 and opencv should be placed directly under the include folder.
I also have tried with the newer
opencvpackage and the same thing happened. It puts the library under.\vcpkg_installed\x86-windows\x86-windows\include\opencv4\opencv2As a workaround I just setup my project properties inside Visual Studio to add the directory
.\vcpkg_installed\x86-windows\x86-windows\include\opencv4\to it's additional include directories, but I thought vcpkg was supposed to take care of this? Am I missing something? Some extra step to tell vcpkg to not create that extra root folder?Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions