OpenCV Compilation/Linking Errors in async.hpp, version.hpp, dict.hpp, etc. when #include <opencv2/dnn.hpp> and <opencv2/opencv.hpp>
I installed OpenCV[dnn] 64-bit and jsoncpp using vcpkg. I can successfully use jsoncpp in my project and ./vcpkg list successfully lists 9 OpenCV packages including dnn.
I also have both of the include statements listed in the title, in my Visual Studio project. Yet I still get errors in files on compilation such as:
Severity Code Description Project File Line Suppression State Suppression State
Error C3646 'CV_NOEXCEPT': unknown override specifier (compiling source file src\main.cpp) Rocket League Inventory Extractor C:\Dev\vcpkg\installed\x64-windows\include\opencv2\core\async.hpp 34
Error C2143 syntax error: missing ';' before '{' (compiling source file src\main.cpp) Rocket League Inventory Extractor C:\Dev\vcpkg\installed\x64-windows\include\opencv2\dnn\version.hpp 15
Error C2447 '{': missing function header (old-style formal list?) (compiling source file src\main.cpp) Rocket League Inventory Extractor C:\Dev\vcpkg\installed\x64-windows\include\opencv2\dnn\version.hpp 15
Error C2059 syntax error: '(' (compiling source file src\main.cpp) Rocket League Inventory Extractor C:\Dev\vcpkg\installed\x64-windows\include\opencv2\dnn\dnn.inl.hpp 49
Error C2143 syntax error: missing ';' before '{' (compiling source file src\main.cpp) Rocket League Inventory Extractor C:\Dev\vcpkg\installed\x64-windows\include\opencv2\dnn\dnn.hpp 55
Error C2059 syntax error: '(' (compiling source file src\main.cpp) Rocket League Inventory Extractor C:\Dev\vcpkg\installed\x64-windows\include\opencv2\dnn\layer.hpp 48
Error C2059 syntax error: '(' (compiling source file src\main.cpp) Rocket League Inventory Extractor C:\Dev\vcpkg\installed\x64-windows\include\opencv2\dnn\utils\inference_engine.hpp 14
Error C2039 'Net': is not a member of 'cv::dnn' Rocket League Inventory Extractor C:\Users\Unknown_User\Documents\openFrameworks\apps\fantastic-finale-astudent82828211\Rocket League Inventory Extractor\src\main.cpp 44
How do I go about properly linking the dnn module and the other modules that cause errors that are within OpenCV?
which VS version do you use ?
3rd party, not an official distro.
try to use official releases or even to build from src
just curious, what's this
Rocket League Inventory Extractor
doing there in the error output ?btw, all above are compile NOT linker errors.
I tried to build from source and contrib using CMake but kept getting errors when attempting to Configure with CMake about some library missing or some path not being found. I made a stackoverflow post and was told to try vcpkg. Here's that stackovcerflow post: https://stackoverflow.com/questions/5...
Rocket League Inventory Extractor is the actual project ("solution") that contains main.cpp and is using opencv2. And I thought they were linking errors because it seems like it's only issues in files like async.hpp and layer.hpp which are in opencv and not something I wrote.
And the Visual Studio version is 2019
Here are my compilation errors:
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off Could NOT find BLAS (missing: BLAS_LIBRARIES) LAPACK requires BLAS A library with LAPACK API not found. Please specify library location. VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file CMake Error at cmake/OpenCVModule.cmake:289 (message): No modules has been found: C:/Dev/opencv/Downloads/opencv_contrib-4.1.2 Call Stack (most recent call first): cmake/OpenCVModule.cmake:371 (_glob_locations) modules/CMakeLists.txt:7 (ocv_glob_modules)
OpenCV Python: during development append to PYTHONPATH: C:/Dev/opencv/python_loader Registering hook 'INIT_MODULE_SO