如何将 gdal api 集成到 visual studio 2012 C++
how to integrate gdal api to visual studio 2012 C++
我是 geotiff 处理的新手。现在,我需要使用 gdal Api 读取我的 geotiff 数据。我想将 gdal 集成到 visual studio 以便我可以使用 C++。我已经通过推荐 makegdal_gen 10.00 64 > gdal10.vcproj 成功地为 VS 项目生成了 gdal。但是,我丢失了几个 header,它们在 gdal 目录或文件夹中不存在,例如 hdf.h 等。我想问一下,有人知道我在哪里可以找到完整的 gdal 或者有什么方法可以导入gdal 到 visual studio C++ 容易吗?谢谢
生成 gdal10.vcproj
后,您需要构建它。
您应该遵循 official documentation。
主要步骤(根据文档稍作修改,假设您使用的是最新版本的 VS):
Check the basic options in nmake.opt, especially the settings for the VC variant to use and for the installation directory.
Open "Visual Studio Command Prompt" in the start menu. If you plan to compile for the 64bit platform be sure to choose the correct bat / command prompt.
Go to the GDAL root directory and do the following:
C:\GDAL> nmake /f makefile.vc
Once the build has completed successfully, you can also install the required GDAL files for using GDAL utilities using the install makefile target. Ensure that BINDIR, and DATADIR are set appropriately in the nmake.opt file before doing this.
C:\GDAL> nmake /f makefile.vc install
If you wish to build your own applications using GDAL you can use the following command to install all the required libraries, and include files as well. Ensure that LIBDIR and INCDIR are properly set in the nmake.opt file.
C:\GDAL> nmake /f makefile.vc devinstall
Projects linking against GDAL should include the directory specified in INCDIR in the include path, and the directory specified in LIBDIR in their /LIBPATH. To use gdal link against the gdal_i.lib stub library.
我是 geotiff 处理的新手。现在,我需要使用 gdal Api 读取我的 geotiff 数据。我想将 gdal 集成到 visual studio 以便我可以使用 C++。我已经通过推荐 makegdal_gen 10.00 64 > gdal10.vcproj 成功地为 VS 项目生成了 gdal。但是,我丢失了几个 header,它们在 gdal 目录或文件夹中不存在,例如 hdf.h 等。我想问一下,有人知道我在哪里可以找到完整的 gdal 或者有什么方法可以导入gdal 到 visual studio C++ 容易吗?谢谢
生成 gdal10.vcproj
后,您需要构建它。
您应该遵循 official documentation。
主要步骤(根据文档稍作修改,假设您使用的是最新版本的 VS):
Check the basic options in nmake.opt, especially the settings for the VC variant to use and for the installation directory.
Open "Visual Studio Command Prompt" in the start menu. If you plan to compile for the 64bit platform be sure to choose the correct bat / command prompt.
Go to the GDAL root directory and do the following:
C:\GDAL> nmake /f makefile.vc
Once the build has completed successfully, you can also install the required GDAL files for using GDAL utilities using the install makefile target. Ensure that BINDIR, and DATADIR are set appropriately in the nmake.opt file before doing this.
C:\GDAL> nmake /f makefile.vc install
If you wish to build your own applications using GDAL you can use the following command to install all the required libraries, and include files as well. Ensure that LIBDIR and INCDIR are properly set in the nmake.opt file.
C:\GDAL> nmake /f makefile.vc devinstall
Projects linking against GDAL should include the directory specified in INCDIR in the include path, and the directory specified in LIBDIR in their /LIBPATH. To use gdal link against the gdal_i.lib stub library.