GDAL集成MrSID编译及fatal error C1189问题

一、环境
  1. VS 2017
  2. Window 10
  3. GDAL 2.3.0
二、下载MrSID DSDK
  1. 下载MrSID DSDK:MrSID_DSDK-9.5.4.4709-win64-vc15.zip
  2. 选择所需的MrSID DSDK版本:

1 选择相应版本的DSDK

二、配置编译选项
  1. 指定MSVC_VER=1910 (VS2017)
  2. 以64位编译:WIN64=YES
  3. MrSID配置项:MRSID_DIR=%mrsid_dir%(实际mrsid路径), MRSID_JP2=YES
  4. 以plugin方式编译

         D:\gdal\gdal-1.11.1\frmts\mrsid>nmake /f makefile.vc plugin

        在nmake.opt中增加:

        MRSID_PLUGIN = YES

        MRSID_LIDAR_PLUGIN = YES

三、问题解决
  1. fatal error C1189: PLATFORM ERROR

       mrsid_dsdk-9.5.4.4709-win64-vc15\raster_dsdk\include\lt_platform.h(102): fatal error C1189: #error: PLATFORM ERROR: unknown compiler (编译源文件 mrsidstream.cpp)

  mrsid_dsdk-9.5.4.4709-win64-vc15\raster_dsdk\include\lt_platform.h(102):fatal error C1189: #error:  PLATFORMERROR: unknown compiler (编译源文件 mrsiddataset.cpp)

   NMAKE : fatal error U1077: “"C:\ProgramFiles (x86)\Microsoft VisualStudio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\cl.EXE"”: 返回代码“0x2”

      Stop.

      NMAKE : fatal error U1077: “for”: 返回代码“0x1”

      Stop.

  NMAKE : fatal error U1077: “"C:\ProgramFiles (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\nmake.EXE"”: 返回代码“0x2”

    Stop.

     解决 修改lt_platform.h中 _MSC_VER <=1910,为符合所用VS2017对应的版本号。

     延伸:查看版本号 cl -Bv

图2. 查看VS版本

四、结果测试
  1. gdalinfo --formats


图3.  查看GDAL支持的格式

   2. gdalinfo sid

图4. 读取sid文件

参考:
  1. MrSID Decode SDK (DSDK):  https://www.lizardtech.com/developer/portal-sdk
  2. Building with MrSID SDK: https://trac.osgeo.org/gdal/wiki/MrSID
  3. Building on Windows: https://trac.osgeo.org/gdal/wiki/BuildingOnWindows
  4. How to add MrSID support into GDAL: https://trac.osgeo.org/ubuntugis/wiki/TutorialMrSid
  5. Building with MrSid support enabled: https://github.com/naturalatlas/node-gdal/issues/88
资源

  1.  MrSID_DSDK-9.5.4.4709-win64-vc15.zip
  2. GDAL-2.3.0-Win64-msvc1910编译结果
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值