Hi,
I am a windows and VS2019 user anc C/C++ developer and I asked this question 
myself a long time ago.

Finally the best way for me was:


1)      Install vcpkg https://vcpkg.io/en/getting-started and install this on 
c:/dev/vcpkg. Follow their instructions. And then gdal instructions 
(https://gdal.org/download.html#vcpkg)

a.       git clone https://github.com/Microsoft/vcpkg.git

b.       .\vcpkg\bootstrap-vcpkg.bat

c.       vcpkg integrate install

d.       .\vcpkg install gdal --triplet=x64-windows

2)      Use this line to install all gdal needs: vcpkg --triplet x64-windows 
install curl expat geos lerc libdeflate libgeotiff libiconv libpng libxml2 
openssl proj qhull sqlite3[rtree] xerces-c zlib

3)      Install python using vcpkg: vcpkg install python3

4)      Clone gdal https://github.com/OSGeo/gdal to some directory (let’s call 
it “$Gdal$”)

5)      Set the system environment variable GDAL_DATA to $Gdal$\build\data

6)      Go to the folder $Gdal$ in cmd and

a.       cmake -B build -S . 
-DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake  
(<-- look for this file in your vcpkg installation: I have two vcpkg levels, I 
don’t know why but I don’t care)

b.       cmake --build build

It should work. If it doesn’t, tell us and let’s see if I missed something.
If it’s worth perhaps we can document it in somewhere on gdal page, cause it’s 
a long journey to set all this. It’s not clear anywhere.



De: gdal-dev <gdal-dev-boun...@lists.osgeo.org> En nombre de Mübin Içyer via 
gdal-dev
Enviado el: dijous, 7 de març de 2024 8:30
Para: gdal-dev@lists.osgeo.org
Asunto: [gdal-dev] Building on windows

Hi,

I want to build GDAL on Windows with Visual Studio 17 2022, but I couldn't.
I tried to install all necessary packets with conda but I receive a  lot of 
errors.
Is there any new tutorial that shows how to build on windows with current and 
new packets?

Thanks. Regards
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to