[Gdal-dev] Trouble in link with hdf4

Fu Chen fchen at ne.rsgs.ac.cn
Tue Nov 18 03:51:52 EST 2003


Hi!
I don't know how to link with hdf4 in win32 :< 
First download the prebuilt hdf415 package and unpack it in the gdal root.
Then change two lines in nmake.opt.
HDF4_DIR = D:\gdal\HDF41r5
HDF4_LIB = /LIBPATH:$(HDF4_DIR)\libdbg

But the rebuild of GDAL report the lib collide. I know the GDAL build at /MD or /MDd. But the default build process point to a single-thread hdf lib. cl say "Automatic linking with the debug static single-threaded HDF library".

in hdfi.h

#if defined(_MSC_VER) && !defined(_MFHDFLIB_) && !defined(_HDFLIB_) /* Auto-link when possible */
# define HDF_LIB_VER "415"
# if !defined(_DEBUG)
#  if !defined(_HDFDLL_)
#   define HDF_LIB_NAME "HD" HDF_LIB_VER ".lib"
#   pragma message( "Automatic linking with the static single-threaded HDF library - " HDF_LIB_NAME )
#  else
#   define HDF_LIB_NAME "HD" HDF_LIB_VER "m.lib"
#   pragma message( "Automatic linking with the multithreaded HDF DLL - " HDF_LIB_NAME )
#  endif
# else
#  if !defined(_HDFDLL_)
#   define HDF_LIB_NAME "HD" HDF_LIB_VER "d.lib"
#   pragma message( "Automatic linking with the debug static single-threaded HDF library - " HDF_LIB_NAME  )
#  else
#   define HDF_LIB_NAME "HD" HDF_LIB_VER "md.lib"
#   pragma message( "Automatic linking with the debug multithreaded HDF DLL - " HDF_LIB_NAME  )
#  endif
# endif
# pragma comment(lib, HDF_LIB_NAME )
#endif /* def

The package of prebuilt hdf415 has four lib directories. Is the lib in the dlllibdbg what we need? where should i set the _HDFDLL_ ?

Any suggestion?



More information about the Gdal-dev mailing list