win 编译
编译 gdal
vs 版本对应关系
VC10.0 VS2010 Microsoft Visual Studio 2010
VC11.0 VS2012 Microsoft Visual Studio 2012
VC12.0 VS2013 Microsoft Visual Studio 2013
VC13.0 VS2014 Microsoft Visual Studio 2014
VC14.0 VS2015 Microsoft Visual Studio 2015
VC15.0 VS2017 Microsoft Visual Studio 2017
VC16.0 VS2019 Microsoft Visual Studio 2019
编辑 nmake.opt
MSVC_VER=1900 (msvc version)
GDAL_HOME = “D:\GDAL\gdal” (build path)
#WIN64=YES修改为WIN64=YES (building for 64-bit windows)
build gdal
打开 x64 Native Tools Command Prompt for VS 2015
cd D:\GDAL\gdal-2.3.2
nmake /f makefile.vc MSVC_VER=1900 WIN64=yes
nmake /f makefile.vc install MSVC_VER=1900 WIN64=yes
nmake /f makefile.vc devinstall MSVC_VER=1900 WIN64=yes
opencv build with gdal
- configure, 选择vs2015, 选择x64
CMAKE_FORCE_3RDPARTY_BUILD ON
BUILD_SHARED_LIBS OFF
WITH_GDAL ON- configure, 出现GDAL include dir 和 lib path
GDAL_INCLUDE_DIR xxx/include
GDAL_LIBRARY xxx/lib/gdal_i.lib- Configure, Generate, Open Project
ubuntu 18.04 编译
cd gdal
./configure --prefix=xxx/gdal/build
make -j8
make install