Reputation: 21
Context: My project uses OpenCV and I realised that working with MVSC is easier than mingw for OpenCV. I successfully changed teh complier and even using the Developer command prompt so i dont have problems with enviormental variables (couldn't see the CCX variable on normal terminal)
Problem: To create a build directory, I use the command cmake -B build -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX
in Developer command prompt 2022. I recive the following warning
-- OpenCV ARCH: x86
-- OpenCV RUNTIME:
-- OpenCV STATIC: ON
CMake Warning at C:/Users/kamal/opencv/build/OpenCVConfig.cmake:190 (message):
Found OpenCV Windows Pack but it has no binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
CMakeLists.txt:74 (find_package)
CMake Error at CMakeLists.txt:74 (find_package):
Found package configuration file:
C:/Users/kamal/opencv/build/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
I know that the openCV verison is not compatiable, but I have no idea why. It is locating the place of the binary correctly and it is the latest version of open CV and MVSC (maybe this is an issue)
In that warning text I have noticed lines that I think might be problematic but not sure if they are:
1- it says OpenCV ARCH: x86
but my machine is x64. though my visial studio is located at Program Files (x86)\Microsoft Visual Studio\2022\
2- when i go to the path of the open cv bin i find C:\Users\...\opencv\build\x64\vc16\bin
and I have read somewhere that visual studio 2022 uses v17 not v16
I think the problem lies in the 2nd point but I dont know how to fix it. Should I downgrade my visual studio version or I read somewhere you can recompile openCV on the new visual studio is that even possiable ? I am looking for a solution if the problem is point 2 or if I missed something somewhere else.
Upvotes: 1
Views: 227