我一直在 python 中试验 GDAL,并在将其用于地形分析方面取得了一些巨大的成功。我的公司希望了解 GDAL 是否/如何在 Visual Studio 中使用,因为它是他们的主要平台。
我已按照此处下的说明下载并安装了 GDAL v1.8从源代码构建”我是 MSVS 新手,不确定如何包含必要的标头以在新项目中使用 GDAL 库。
我如何包含这些库?非常感谢您的帮助!
I've been experimenting with GDAL in python and have had some great success in it's use for terrain analysis. My company wants to see if/how GDAL can be used in Visual Studio, as it is their primary platform.
I've downloaded and installed GDAL v1.8 in accordance with the instructions found here under "Building from Source" I'm new to MSVS and not sure how to include the necessary headers to utilize the GDAL libraries in a new project.
How do I include the libraries? Your help is much appreciated!
发布评论
评论(2)
如果您询问如何在新的 Visual Studio 项目中指定 GDAL 包含路径,则可以在“C/C++ > 常规 > 附加包含目录"。
如果有任何要链接的库,那么您可以在“链接器 > 输入 > 附加依赖项”。
这两个设置都可以在项目的属性页面中找到。
If you are asking how to specify the GDAL include path in new Visual Studio projects, then you can do so under "C/C++ > General > Additional Include Directories".
Should there be any libraries to link to, then you can specify these under "Linker > Input > Additional Dependencies".
Both of these settings can be found in your project's properties page.
成功构建 GDAL 后,您需要三个项目设置(在
Properties
下):Configuration Properties
-> 设置 GDAL 包含目录的路径C/C++
->常规
->其他包含目录
配置属性
-> 设置 lib 目录的路径(其中gdal_i.lib
位于)。C/C++
> >链接器
>常规
>其他库目录
gdal_i.lib
添加到配置属性
->C/C++
> >链接器
>输入
>其他依赖项
然后,您可以在 C++ 代码中使用 GDAL,如 GDAL API 中所述教程。
After you successfully build GDAL you need three project settings (under
Properties
):Configuration Properties
->C/C++
->General
->Additional Include Directories
gdal_i.lib
is located) atConfiguration Properties
->C/C++
>Linker
>General
>Additional Library Directories
gdal_i.lib
toConfiguration Properties
->C/C++
>Linker
>Input
>Additional Dependencies
You can then use GDAL in your C++ code as described in the GDAL API tutorial.