Open source GIS Library gdal configuration under Windows Codeblocks

Source: Internet
Author: User


Recently in the study of open source GIS library gdal, I used to download the source code to compile the way, mainly in the following several steps:

  1. Download gdal source, download page for Https://trac.osgeo.org/gdal/wiki/DownloadSource, currently the latest version of the 2.0.1,windows version for the http://download.osgeo.org/ Gdal/2.0.1/gdal201.zip

    After downloading the extract, I extracted here to the C packing directory, and in the root directory to create a new folder Gdal-runtime, as a result of storing the compilation:

  2. Enter gdal-2.0.1, open the nmake.opt file, locate gdal_home, and change the value to the path gdal-runtime the previous step.

    Find msvc_ver to change the value to the current version of Visual Studio, I use VS2012, the value is 1700

    gdal1.6 and before the seemingly also need to change the source files, 2.0.1 do not

  3. Open the command-line tool that comes with Visual Studio:

    Go to the Gdal folder,cd "C:\gdal-2.0.1", and execute the following command in turn (it takes a little time):

  4. nmake/f makefile.  /F Makefile.  /F makefile.vc devinstall

    After compiling, the following folder will be generated in "C:\gdal-runtime" to represent the successful compilation

  5. Create a new Codeblocks project, copy the Gdalxxx.dll from the previous "C:\gdal-runtime\bin" directory to the project root directory

    Open the Project-build Options menu and add "C:\gdal-runtime\lib\gdal_i.lib" to link libraries under Linker settings

    In search Directories-complier , add the path "C:\gdal-runtime\include"in the "search add "C:\gdal-runtime\lib " in Directories-linker "

  6. The configuration is complete here, and here are some common issues:

    1. If you are prompted to not find NMAKE, you need to join the folder "C:\Program Files\Microsoft Visual Studio 12.0\vc\bin" that NMAKE is in to the system path, and then reopen the command line

    2. If you call NMAKE compile-time prompt "stdio.h not found", you will need to add the Windows SDK and the include path to Visual Studio in the system variable include (new if it does not exist)

    3. If you are prompted with an "RC" variable error, you need to perform "C:\Program Files\Microsoft Visual Studio 12.0\vc\bin\vcvars32.bat" before you execute NMAKE

Open source GIS Library gdal configuration under Windows Codeblocks

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.