LoginSignup
1
1

More than 3 years have passed since last update.

GDAL windows visual C++ (2017) 環境の構築

Posted at

GDALをvisual C++(2017) windows10 x64で使うための環境構築です。

ダウンロード

gdal
 http://download.osgeo.org/gdal/CURRENT/
 から、
 gdal302.zip
 をダウンロードして解凍

PROJ
 以下を参考にインストール
 https://proj.org/install.html#windows
  インストーラをダウンロードしてインストールします


コンパイル

コマンドプロンプトから
cd gdal302\gdal-3.0.2\
generate_vcxproj 15.0 64 gdal_vs2017

を実行、次に

nmake -f makefile.vc MSVC_VER=1910 PROJ_INCLUDE="-I C:\XXXX\OSGeo4W64\include" PROJ_LIBRARY="C:\XXXX\OSGeo4W64\lib\proj_6_2.lib" WIN64=1

 XXXXはPROJをインストールした場所

はまりポイント
  1. PROJ_INCLUDEとPROJ_LIBRARYをつけないと通りませんでした
  2. win64=1をつけないとリンカーエラーになります
  3. PROJ_INCLUDEはディレクトリ指定で-Iが必要なのに PROJ_LIBRARYは直接ファイルを指定するのがポイント

実行(テスト)

sqlite3.dllが必要でした。
 https://www.sqlite.org/download.html
 からsqlite-dll-win64-x64-3300100.zipをダウンロードします

テスト用サンプルは以下にあります。
 https://gdal.org/tutorials/raster_api_tut.html#

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1