zoukankan      html  css  js  c++  java
  • 编译MapWinGis

    其实在github下载的MapWinGIS代码,在support文件夹下的build文件夹下的HowToBuild说明已经写的很清楚了,

    * How to build MapWinGIS.ocx*
    * Paul Meems
    * October 19, 2014
    Since MapWinGIS v4.9.1 we use the pre-build binaries
    of Tamas (http://www.gisinternals.com/).
    This has dramatically simplyfied the build process.
    First download the bins and libs from GisInternals.
    Since MapWinGIS v4.9.3 we use the GDALv2 library.
    At this moment it is not yet formally released so we now use the -development files.
    Browse to http://www.gisinternals.com/query.html?content=filelist&file=release-1600-gdal-mapserver.zip (this is a link not a file!)
    and download
    http://download.gisinternals.com/sdk/downloads/release-1600-gdal-mapserver.zip
    http://download.gisinternals.com/sdk/downloads/release-1600-gdal-mapserver-libs.zip
    Because Tamas does not yet provide VS2013 binaries we use his VS2010 (1600) binaries.
    Unzip these files in MapWinGIS runkSupportingLibrariesGDAL_SDK{VS-version}in{platform}
    MapWinGIS runkSupportingLibrariesGDAL_SDK{VS-version}lib{platform}
    and MapWinGIS runkSupportingLibrariesGDAL_SDK{VS-version}include

    Now you can compile the ocx, using VS2010.
    Don't forget to register it using MapWinGIS runkinWin32 egMapWinGIS.cmd and you are
    ready to go.
    Don't forget you also need the 32-Bit version if you want to use the ocx in Visual Studio in your forms.
    Visual Studio (even VS2013) doesn't support 64-Bit ActiveX controls.

    这里个人知识遇到些问题再次记录下

    用vs2015打开MapWinGIS.sln,如果直接编译会报错,因为默认缺少GDAL库,此时可以去http://www.gisinternals.com/下载对应的库,网站的库包含win32和x64的,建议都下载

    因为要在vs的窗体中使用ocx,同时需要注册32位的ocx,vs2015目前也不支持64位的com组件,

    1、下载MapWinGIS源码,打开MapWinGIS.sln

    2、下载GDAL库,分别放置到对应的位置,win32和x64分别都应该放置各自的库,要放置的位置有三个文件夹(bin, include, lib)

      上面编译文档里让下载1600版本的gdal库,可能是很久没修改了,但是MapWinGIS是在vs2013环境下编译的,所以应该下载vs2013版本的gdal库

       

      分别点击进入MSVC2013的win32 和x64的release-1800-gdal-2-2-3-mapserver-7-0-7和release-1800-x64-gdal-2-2-3-mapserver-7-0-7,进入后如下界面

      

      release-1800-gdal-2-2-3-mapserver-7-0-7-libs.zip里面包含lib和include文件夹

      release-1900-gdal-2-2-3-mapserver-7-0-7-libs.zip里面包含bin文件夹

       然后将下载好的lib、include、bin放入GDAL_SDK文件夹下对应的目录中

    3、在win32和x64生成对应的ocx,此时生成成功的时候vs报要用管理员来进行注册,此时重新用管理员打开生成即可,但是如果你想再次生成时,如果没问题略过下面操作

      如果vs又会报错要用管理员生成,目前我也不知道为什么vs每生成一次都需要管理员生成,(希望多多指教),此时可以在工程属性中 ---链接器---注册输出--设置为否,此时每次有更新你得自己反注册和再次注册

    4、如果注册不成功,可以用Depends工具打开看看是否有依赖的库找不到,我这边是注册不成功的,于是发现bin目录下的库有些没有拷贝过来,于是我直接将bin目录下的东西全部拷贝到生成目录中,此时再次注册就成功了

    5、在winform中使用MapWinGIS,此时在工具箱中添加Com组件,此时添加的MapWinGIS.ocx的版本和你工程所用的目标平台一样,如果是x64,就添加64位的MapWinGIS.ocx到工具箱,此时如果添加失败,确保ocx都已注册,(添加64位的ocx也需要注册32位的)

    以上就是MapWinGIS的编译和使用上我遇到的一些问题

  • 相关阅读:
    Tomcat造成404
    ajax缺少@ResponseBody注解前台404,业务可以运行
    几种常见的Runtime Exception
    SQL注入通俗讲解
    MYSQL数据库导入大数据量sql文件失败的解决方案
    css选择器
    http端口
    基础算法之最大子列求和问题
    基础算法之链表逆序
    Prolog&Epilog
  • 原文地址:https://www.cnblogs.com/marblemm/p/7040608.html
Copyright © 2011-2022 走看看