运行VS编译含h5读写程序报错,HDF5 library version mismatched error,Headers are 1.14.0, library is 1.10.2

问题:

报错内容如下:

Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.14.0, library is 1.10.2

总结起来就是:VS应用程序由一个版本的HDF5编译,但运行编译好的程序时却与不同版本的静态或共享HDF5库链接,因此报错Headers are 1.14.0, library is 1.10.2,不匹配

分析:

系统刚重装,并没有安装1.10.2版本的hdf5软件,经过检查也并没有。因此,删除1.10.2版本思路行不通。

所以思路是,要运行成功,则需要编译的库与运行时的链接库相同。

解决办法:

1、将运行程序所需的动态链接库,放置到程序所在的目录下。(相关的dll文件)

2、放置到,c:/windows/system32中

其他总结:

使用静态链接库,可能需要具有正确版本HDF5库的库文件(.lib)以及对应的头文件(.h)。

使用动态链接库加载需要确保正确版本的共享库文件(.dll)位于可执行文件的搜索路径上或者已将其路径添加到系统环境变量中。

如果不知道具体需要啥,就把所有bin文件夹下的dll文件复制过去


基本上,编译时不报错,运行时报错,都可以复制dll文件的方法解决

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值