OpenCV Compilation/Linking Errors in async.hpp, version.hpp, dict.hpp, etc. when #include <opencv2/dnn.hpp> and <opencv2/opencv.hpp>

asked 2019-11-30 11:44:56 -0500

bllu gravatar image

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?

edit retag flag offensive close merge delete

Comments

which VS version do you use ?

I installed OpenCV[dnn] 64-bit and jsoncpp using vcpkg

3rd party, not an official distro.

try to use official releases or even to build from src

berak gravatar imageberak ( 2019-11-30 12:01:28 -0500 )edit

just curious, what's this Rocket League Inventory Extractor doing there in the error output ?

berak gravatar imageberak ( 2019-11-30 12:03:30 -0500 )edit

btw, all above are compile NOT linker errors.

berak gravatar imageberak ( 2019-11-30 15:08:09 -0500 )edit

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...

bllu gravatar imagebllu ( 2019-12-02 19:34:14 -0500 )edit

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

bllu gravatar imagebllu ( 2019-12-02 19:36:03 -0500 )edit

Here are my compilation errors:

Could not find OpenBLAS include. Turning OpenBLAS_FOUND off

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

bllu gravatar imagebllu ( 2019-12-02 19:45:25 -0500 )edit