1. Download Gdal191.zip 2 from http://download.osgeo.org/gdal/ , compile with cmd command line
Using cmd command-line compilation, first in the "Start menu \ All Programs \microsoft Visual Studio 2008\visual Studio tools\ Visual Studio 2008 Command Prompt", click "Visual Studio 2008 The command prompt will pop up the following interface:
Then use the CD command to switch to the Gdal source directory, as shown in the following figure:
After switching to the source code directory of the Gdal, enter the command line below and wait until the compilation is finished.
Nmake-f MAKEFILE.VC
Nmake-f MAKEFILE.VC Install
Nmake-f MAKEFILE.VC Devinstall
There are also other commands, such as:
Nmake-f MAKEFILE.VC Clean
Nmake-f MAKEFILE.VC Msvc_ver=1400clean
Nmake-f MAKEFILE.VC msvc_ver=1400debug=1
The command meaning of the above six lines is in turn:
Compiling the Gdal library
Compile the Gdal library and install it (this means to copy the generated Dll,exe and other files to the C:\warmerda\bld directory).
Compile the Gdal library and install the developer mode (the installation means that the developer mode means to copy the header and Lib files from the development include folder to the C:\warmerda\bld directory, which will be in C:\warmerda\ BLD directory of more than two folders, respectively, include and Lib, respectively, is the gdal of the header and Lib files, used to call the Gdal library use).
Cleans up the Gdal library and removes the temporary files generated by the compiled Gdal Library, which acts as a cleanup command in the VS environment.
function as above, but added a msvc_ver=1400, which means compile with VS2005, msvc_ver=1500, means use VS2008 compile, msvc_ver=1600, means use VS2010 compile.
Compile Gdal library debug mode, can be used to debug Gdal source code.
3. In the Vs2008 menu, in Tool Option, add gdal include and Lib folder directories to the Library files and include files respectively
4, new project, copy the Gdal19.dll file to the project directory, and add Gdal_i.lib in Project setting