title: Trying to build GDAL from github using Visual Studio 2019 v16.6.5 on Windows 10 x64
body: <p>I want to use Visual Studio 2019 to build GDAL. But I keep getting errors when trying to build.</p>
  <p>The computer I'm using is Acer Aspire f 15 F5573G-72CP,
  CPU is i7 7500U 2.7GHz, RAM is 16GB, OS is Windows 10 64 bit</p>
  <p>Steps I've taken are:</p>
  <ol>
  <li><p>Download Visual Studio Community, included .NET desktop development, Universal Windows Platform development, Desktop development with C++ and Node.js development.</p>
  </li>
  <li><p>Used GIT BASH from git for windows to pull the repo <a href="https://github.com/OSGeo/GDAL.git" rel="nofollow noreferrer">https://github.com/OSGeo/GDAL.git</a> and located it c:/gdal</p>
  </li>
  <li><p>in c:/gdal/GDAL/nmake.opt:</p>
  <p>3.a. changed line 42 to <code>Line 42: MSVC_VER=1926 </code></p>
  <p>3.b. I uncommented line 260:</p>
  <p><code>Line 259: # PROJ stuff (required dependency: PROJ &gt;= 6)</code></p>
  <p><code>Line 260: PROJ_INCLUDE = -Id:\install-proj\local\include</code></p>
  <p>3.c. Uncommented line 213: <code>Line 213: WIN64=YES</code></p>
  </li>
  <li><p>Also pulled the repo: <a href="https://github.com/OSGeo/PROJ.git" rel="nofollow noreferrer">https://github.com/OSGeo/PROJ.git</a> located at c:/proj/PROJ</p>
  </li>
  <li><p>Using Windows Powershell, <code>cd c:/gdal/gdal</code> -&gt; <code>generate_vcxproj.bat 16.0 64 gdal_vs2019</code>
  which outputs the following:</p>
  </li>
  </ol>
  <pre><code>PS C:\gdal\gdal&gt; .\generate_vcxproj.bat 16.0 64 gdal_vs2019
  The system cannot find the path specified.
  Generating:
    &quot;C:\gdal\gdal\gdal_vs2019.vcxproj&quot;
    &quot;C:\gdal\gdal\gdal_vs2019.vcxproj.user&quot;
    &quot;C:\gdal\gdal\gdal_vs2019.vcxproj.filters&quot;
    &quot;C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj&quot;
    &quot;C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj.user&quot;
    &quot;C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj.filters&quot;
  This might take a little while...
  Projects done!
  Launch Visual Studio IDE
  * Open project &quot;C:\gdal\gdal\gdal_vs2019.vcxproj&quot;
  * Add  project &quot;C:\gdal\autotest\cpp\gdal_vs2019_test.vcxproj&quot;
  * Configure Build Dependencies to build the main project before the test project.
  * Save solution in .sln file
  Done!
  PS C:\gdal\gdal&gt;
  </code></pre>
  <ol start="6">
  <li>Open Visual Studio 2019, open a project or solution, select C:\gdal\gdal\gdal_vs2019.vcxproj, ensure Solution Platforms dropdown is set to x64, Build-&gt;Build Solution, which returns three errors:</li>
  </ol>
  <pre><code>Severity    Code    Description Project File    Line    Suppression State
  Error   U1077   'call' : return code '0x1'  gdal_vs2019 C:\gdal\gdal\NMAKE  1   
  
  Severity    Code    Description Project File    Line    Suppression State
  Error   U1077   '&quot;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\nmake.EXE&quot;' : return code '0x2'   gdal_vs2019 C:\gdal\gdal\NMAKE  1   
  
  Severity    Code    Description Project File    Line    Suppression State
  Error   MSB3073 The command &quot;chcp 65001 &gt;NUL &amp;&amp; nmake -f makefile.vc MSVC_VER=1926 WIN64=1 DEBUG=1 WITH_PDB=1&quot; exited with code 2.  gdal_vs2019 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets  46  
  
  
  </code></pre>
  <p>The Output tab shows:</p>
  <pre><code>1&gt;------ Build started: Project: gdal_vs2019, Configuration: Debug x64 ------
  1&gt;
  1&gt;Microsoft (R) Program Maintenance Utility Version 14.26.28806.0
  1&gt;Copyright (C) Microsoft Corporation.  All rights reserved.
  1&gt;
  1&gt;  cd port
  1&gt;  nmake /nologo /f makefile.vc
  1&gt;  call prev_dllbuild.bat
  1&gt;The system cannot find the path specified.
  1&gt;
  1&gt;C:\gdal\gdal\port&gt;IF NOT EXIST dllbuild.prev (ECHO 1 ) 1&gt;dllbuild.prev
  1&gt;
  1&gt;C:\gdal\gdal\port&gt;SET /P PREV_DLLBUILD= 0&lt;dllbuild.prev
  1&gt;
  1&gt;C:\gdal\gdal\port&gt;IF NOT &quot;1&quot; == &quot;1&quot; (ECHO 1 ) 1&gt;dllbuild.prev
  1&gt;NMAKE : fatal error U1077: 'call' : return code '0x1'
  1&gt;Stop.
  1&gt;NMAKE : fatal error U1077: '&quot;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\nmake.EXE&quot;' : return code '0x2'
  1&gt;Stop.
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(46,5): error MSB3073: The command &quot;chcp 65001 &gt;NUL &amp;&amp; nmake -f makefile.vc MSVC_VER=1926 WIN64=1 DEBUG=1 WITH_PDB=1&quot; exited with code 2.
  1&gt;Done building project &quot;gdal_vs2019.vcxproj&quot; -- FAILED.
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  
  </code></pre>
  <p>How should I address these errors to get GDAL built successfully?</p>