开发者

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):

  1. Set the path to the GDAL include directory at Configuration Properties -> C/C++ -> General -> Additional Include Directories
  2. Set the path to your lib directory (where gdal_i.lib is located) at Configuration Properties -> C/C++ > Linker > General > Additional Library Directories
  3. Add gdal_i.lib to Configuration Properties -> C/C++ > Linker > Input > Additional Dependencies

You can then use GDAL in your C++ code as described in the GDAL API tutorial.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜