You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently tried to compile OpenCV's HDF module, which only works by default while linking to a shared HDF5 libary. However, as it's a single-module dependendy, statically linking to HDF5 is advantageous here. Still, this results in linker errors caused by hardcoded configuration options for shared library linking. In particular, the flags inside the Windows branch in the CMakeLists.txt defined by
result in linker errors. After removing them, only a linker error from the missing ShLwApi.Lib is raised.
These two issues can be resolved by extending above line to
and compiling works with both, shared and static library linking to HDF5.
Still, we wanted to discuss this as an issue first before creating a respective PR.
Steps to reproduce
After cloning OpenCV's main and contrib repositories, run CMake with the following flags:
OPENCV_EXTRA_MODULES_PATH pointing to the contrib's modules directory
HDF5_INCLUDE_DIRS pointing to the include directory inside the HDF5 path (generated by its CMake install)
HDF5_C_LIBRARY pointing to the static lib/libhdf5.lib in the same path
Now, building of the HDF module raises a bunch of linker error.
Issue submission checklist
I report the issue, it's not a question
I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found any solution
I updated to the latest OpenCV version and the issue is still there
There is reproducer code and related data files: videos, images, onnx, etc
The text was updated successfully, but these errors were encountered:
System information (version)
Detailed description
We recently tried to compile OpenCV's HDF module, which only works by default while linking to a shared HDF5 libary. However, as it's a single-module dependendy, statically linking to HDF5 is advantageous here. Still, this results in linker errors caused by hardcoded configuration options for shared library linking. In particular, the flags inside the Windows branch in the
CMakeLists.txt
defined byresult in linker errors. After removing them, only a linker error from the missing
ShLwApi.Lib
is raised.These two issues can be resolved by extending above line to
and compiling works with both, shared and static library linking to HDF5.
Still, we wanted to discuss this as an issue first before creating a respective PR.
Steps to reproduce
After cloning OpenCV's main and contrib repositories, run CMake with the following flags:
OPENCV_EXTRA_MODULES_PATH
pointing to the contrib'smodules
directoryHDF5_INCLUDE_DIRS
pointing to theinclude
directory inside the HDF5 path (generated by its CMake install)HDF5_C_LIBRARY
pointing to the staticlib/libhdf5.lib
in the same pathNow, building of the HDF module raises a bunch of linker error.
Issue submission checklist
forum.opencv.org, Stack Overflow, etc and have not found any solution
The text was updated successfully, but these errors were encountered: