gdal3.0编译集成hdf4库和hdf5库的方法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gdal3.0编译集成hdf4库和hdf5库的方法相关的知识,希望对你有一定的参考价值。
作者:朱金灿
在编译gdal3.0时集成hdf4和hdf5库时,需要修改源码目录下的nmake.opt对应的hdf4和hdf5部分,具体如下:
# Uncomment the following and update to enable NCSA HDF Release 4 support.下面主要是包含hdf4库的头文件和库文件
HDF4_PLUGIN = NO
HDF4_DIR = D:\\MyProject\\ThirdPartyLib\\CPlusPlus\\hdf4\\x64
!IF "$(DEBUG)" == "1"
HDF4_LIB =$(HDF4_DIR)\\lib\\hdf_D.lib $(HDF4_DIR)\\lib\\mfhdf_D.lib Ws2_32.lib
!ELSE
HDF4_LIB =$(HDF4_DIR)\\lib\\hdf.lib $(HDF4_DIR)\\lib\\mfhdf.lib Ws2_32.lib
!ENDIF
HDF4_INCLUDE = $(HDF4_DIR)\\include
# HDF4 library newer than 4.2.5 has a SDreset_maxopenfiles/SDget_maxopenfiles
# interface which allows opening many HDF files simultaneously (the max
# number of files was previously hardcoded and too low, smth. like 32).
# Uncomment following if your library is newer than 4.2.5.
HDF4_HAS_MAXOPENFILES = YES
# Uncomment the following and update to enable NCSA HDF Release 5 support.下面主要是包含hdf4库的库文件
HDF5_PLUGIN = NO
HDF5_DIR = D:\\MyProject\\ThirdPartyLib\\CPlusPlus\\hdf5\\x64
!IF "$(DEBUG)" == "1"
HDF5_LIB = $(HDF5_DIR)\\lib\\hdf5_D.lib
!ELSE
HDF5_LIB = $(HDF5_DIR)\\lib\\hdf5.lib
!ENDIF
# Needed to define H5_BUILT_AS_DYNAMIC_LIB for windows compilation
# scenarios where it is not exported on the target (non-CMake builds)
HDF5_H5_IS_DLL = YES
其中已编译好的hdf4库和hdf5库在这里下载:hdf4库下载和hdf5库下载。
以上是关于gdal3.0编译集成hdf4库和hdf5库的方法的主要内容,如果未能解决你的问题,请参考以下文章