Incorporating GDAL into MSVS 2008 C++ project
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 开发者_Go百科project.
How do I include the libraries? Your help is much appreciated!
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.
After you successfully build GDAL you need three project settings (under Properties
):
- Set the path to the GDAL include directory at
Configuration Properties
->C/C++
->General
->Additional Include Directories
- Set the path to your lib directory (where
gdal_i.lib
is located) atConfiguration Properties
->C/C++
>Linker
>General
>Additional Library Directories
- Add
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.
精彩评论