基于C++与VS2012的HDF5文件处理(一)

基于C++与VS2012的HDF5文件处理(一)


前言

随着研究的不断深入,处理的数据量越来越大,普通的数据格式读取速度慢,传输效率低等问题暴露无遗,计算时不得不使用一些复杂的数据格式。比起leveldb、lmdb等数据格式,HDF5简单高效,既可以在matlab中调用库函数进行数据预处理,又可以简单地在C++环境中完成配置。

基于VS2012的HDF5环境配置

  • 下载HDF5安装包--下载页面链接

  • Set up path for external libraries and headers

    The path settings will need to be in the project property sheets per project. 
    Go to "Project" and select "Properties", find "Configuration Properties", 
    and then "VC++ Directories".
        
    1.1 If you are building on 64-bit Windows, find the "Platform" dropdown
        and select "x64".
            
    1.2 Add the header path to the "Include Directories" setting.
        
    1.3 Add the library path to the "Library Directories" setting.
        
    1.4 Select Linker->Input and beginning with the
        "Additional Dependencies" line, enter the library names. The
        external libraries should be listed first, followed by the HDF5
        library, and then optionally the HDF5 High Level, Fortran or C++
        libraries. For example, to compile a C++ application, enter:
    
        szip.lib zlib.lib hdf5.lib hdf5_cpp.lib
    

常见问题

  • "无法找到“XXX.exe”的调试信息,或者调试信息不匹配。未使用调试信息生成二进制文件"

解决方法:

  1. 打开菜单 项目->项目属性页
  2. 选择 配置属性->链接器->调试->生成调试信息 改为 是
  3. 选择 配置属性->C/C++ ->常规->调试信息格式 改为 用于“编辑并继续”的程序数据库(/ZI)
  4. 选择 配置属性->C/C++ ->优化->优化 改为 禁用(/Od)
  5. 在菜单栏中选择 生成->重新生成解决方案
  • 未找到xxx库

解决方法:

  1. 把HDF5安装包目录下的bin目录下的dll文件与msvcp110.dll、msvcr110.dll一起复制到xxx/debug文件夹中

原文地址:https://www.cnblogs.com/nwpuxuezha/p/4655014.html