How to install gdal library in Window environment-VC Programming

Source: Internet
Author: User

1. Copy the gdal folder to the D:/Program Files directory (no new directory is visible or another path is selected)
Copy xcopy.exe under the C:/Windows/system32directory to the./Microsoft Visual Studio/vc98/bin directory.
Search for the mspdb60.dll file under the VC directory and copy it to the/vc98/bin directory.
2. Create an autoexec. BAT file.
The content is as follows:
Set Path = D:/program files/Microsoft Visual Studio/vc98/bin
Set include = D:/program files/Microsoft Visual Studio/vc98/include
Set Lib = D:/program files/Microsoft Visual Studio/vc98/lib
(Note: "D:/program files/Microsoft Visual Studio/" is the specific path for VC installation)
Save and copy it to the D:/Program Files directory.
3. Copy vcvars32.bat in the./vc98/bin directory to the D:/Program Files directory.
4. Run CMD and open the console window to enter the Directory D:/Program Files where autoexec. bat is located.
5. Directly type autoexec. BAT and press enter to run it. The autoexec. Bat content is displayed on the screen.
6. Type vcvars32.bat and press enter to run the program. The screen displays setting environment for using Microsoft Visual C tools.
7. Type CD gdal and press enter to enter the gdal directory.
8. Type nmake/F makefile. VC and press enter to process the gdal file.
9 wait for a while, and the processing is complete,
First, modify the file generation path in nmake. Opt:
Modify only one path: gdal_home = "D:/program files/gdal" (other paths can be enclosed in quotation marks) and save the file
10. Type nmake/F makefile. VC install. Wait for a while and the installation is successful.
D: The bin and data folders are generated under the/program files/gdal directory.
11. Type nmake/F makefile. VC devinstall. Wait for a while and the installation is successful.
D: The include and Lib folders are generated under the/program files/gdal directory.
12. Create a project in vc6, such as the console program testgdalconsole. Copy D:/program files/gdal/bin/gdal14.dll to the DEBUG directory under the testgdalconsole directory.
13 in VC, open tool-option and add the gdal lib file directory and header file directory to library files and include files on the directories page, as shown in 1 and 2.

14. Open the project-setting menu and add a file gdal_ I .lib3 to the object/library modules on the Link Page.

Figure 3
15. Add the gdal_priv.h header file to the project to call the function in gdal. For how to use the function, see the gdal API tutorial instructions under gdaldoc.
(If a file cannot be found during installation, search for it in the VC installation directory or below C:/and copy it to the appropriate directory. /vc989/bin or DoS operation directory (here is the D:/Program Files directory), and then repeat the above steps to complete the installation)

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.