findhdf5在请求共享时选择静态库

发布于 2025-02-10 23:50:30 字数 187 浏览 1 评论 0 原文

我已经编译了HDF5-1.8.21,以具有静态和共享库。在项目中,我

set (HDF5_USE_STATIC_LIBRARIES FALSE)
find_package(HDF5 REQUIRED)

仅选择共享库版本,但它不起作用。它与findhdf5.cmake中的文档相矛盾。我不知道原因。

I have compiled hdf5-1.8.21 to have both static and shared libraries. In the project I use

set (HDF5_USE_STATIC_LIBRARIES FALSE)
find_package(HDF5 REQUIRED)

to just select the shared library version but it does not work. It contradicts with the documentation in FindHDF5.cmake. I do not know the reason for it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尤怨 2025-02-17 23:50:30

确保使用静态hdf5库目标 static hdf5库目标 hdf5_lib_target 而不是 hdf5_libsh_target

Make sure do target_link_libraries for you binary/library with static HDF5 library target HDF5_LIB_TARGET and not HDF5_LIBSH_TARGET

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文