zoukankan      html  css  js  c++  java
  • 如何正确的将HDF5加入到项目中进行编译(雾)?!

    //-----------------------------------------------------------------------

    //更新(重要):请直接使用1.8.15版本

    //这都是新版本的问题

    //-----------------------------------------------------------------------

    1 什么是HDF5

    官方解释:

    HDF5 is a unique technology suite that makes possible the management of extremely large and complex data collections.

    看起来HDF5就是一种用来存储各种数据的一个容器/管理者。

    2 为什么要弄这个组件到项目中去?

    鉴于很多模型都使用这个格式进行数据存储,所以在测试项目是难免会用到HDF5这个部分。所以这里对其加入到项目中做了以下总结。

    3 将HDF5加入到项目需要那几步?可能会遇到什么问题了?

    大体上可以总结为三个部分:

    (1)下载合适的部分

      这个当然难不到聪明的你了,放一个链接:https://support.hdfgroup.org/HDF5/release/obtain518.html  

    选择 Windows 64-bit (No SZIP)   [1]   Compilers:   CMake VS 2013 C, C++, IVF 15

      or (https://support.hdfgroup.org/HDF5/release/obtain5.html)

      注意:这里选择了x64版本

    (2)添加到项目中

    Add the header path to the "Include Directories" setting.

      eg:C:Program FilesHDF_GroupHDF51.8.18include

    Add the library path to the "Library Directories" setting.

      eg:C:Program FilesHDF_GroupHDF51.8.18lib

      添加头文件和库文件到C++目录中去,

      添加HDF5的bin文件到环境path中: eg:C:Program FilesHDF_GroupHDF51.8.18in

    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

      添加合适的lib进行编译

      由于我选择了 NoSZIP的版本,结果就是  

    zlib.lib hdf5.lib hdf5_cpp.lib

    (3)编译

      进行了上述的操作了就完成了99%,为什么?

      接下来就会遇到 error LNK2001: 无法解析的外部符号 _H5T_NATIVE_DOUBLE_g

      这样的问题,所以bing搜索找到了解决方案():

      《1》http://www.cnblogs.com/yeahgis/p/3141441.html

      《2》http://www.xuebuyuan.com/1267127.html

      but these solutions don't work. why?

      很是疑惑的我想着官方网站能不能给我一些提示:https://support.hdfgroup.org/HDF5/release/obtain518.html  

      下面有一个行字比较醒目:To use the shared libraries on Windows with Visual Studio you must specify the H5_BUILT_AS_DYNAMIC_LIB compile definition.

      是的将H5_BUILT_AS_DYNAMIC_LIB加入到编译器预编译选项,就解决了上面了问题。

      

    文章参考:

    1. http://www.cnblogs.com/nwpuxuezha/p/4655014.html

    2. http://www.cnblogs.com/yeahgis/p/3141441.html

    3. http://www.xuebuyuan.com/1267127.html

    4. https://support.hdfgroup.org/HDF5/release/obtain518.html

    5. https://support.hdfgroup.org/HDF5/release/obtain5.html

  • 相关阅读:
    ASP.NET Core项目解读之常用概念方法
    ASP.NET Core项目解读之appsettings.json
    ASP.NET Core项目解读之wwwroot
    ASP.NET Core项目解读之launchSettings.json
    理解.NET5
    搜索引擎学习(四)中文分词器
    搜索引擎学习(五)Lucene操作索引
    搜索引擎学习(三)Lucene查询索引
    搜索引擎学习(二)Lucene创建索引
    搜索引擎学习(一)初识Lucene
  • 原文地址:https://www.cnblogs.com/kalluwa/p/6413686.html
Copyright © 2011-2022 走看看