[gdal-dev] Compiling GDAL with Visual Studio 2019

Mateusz Loskot mateusz at loskot.net
Tue Sep 8 11:00:29 PDT 2020


On Tue, 8 Sep 2020 at 14:50, Alexis Vaisse <alexis.vaisse at wysilab.com> wrote:
>
> D:\Terrain\Extern\gdal-3.1.3>nmake -f makefile.vc MSVC_VER=1927 WIN64=1
>
> Microsoft (R) Program Maintenance Utility Version 14.27.29110.0
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
>         cd port
>         nmake /nologo /f makefile.vc
>         call prev_dllbuild.bat
> The system cannot find the path specified.
>
> D:\Terrain\Extern\gdal-3.1.3\port>IF NOT EXIST dllbuild.prev (ECHO 1 ) 1>dllbuild.prev
>
> D:\Terrain\Extern\gdal-3.1.3\port>SET /P PREV_DLLBUILD= 0<dllbuild.prev
>
> D:\Terrain\Extern\gdal-3.1.3\port>IF NOT "1" == "1" (ECHO 1 ) 1>dllbuild.prev
> NMAKE : fatal error U1077: 'call' : return code '0x1'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.EXE"' : return code '0x2'
> Stop.

I downloaded latest
https://github.com/OSGeo/gdal/releases/download/v3.1.3/gdal-3.1.3.tar.gz,
unpacked, and tried to build:

```
D:\tmp\gdal\gdal-3.1.3>nmake -f makefile.vc MSVC_VER=1927 WIN64=1
EXT_NMAKE_OPT=D:\tmp\gdal\gdal-3.1.3\nmake.opt.local

Microsoft (R) Program Maintenance Utility Version 14.27.29111.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        cd port
        nmake /nologo /f makefile.vc
        call prev_dllbuild.bat

D:\tmp\gdal\gdal-3.1.3\port>IF NOT EXIST dllbuild.prev (ECHO 1 ) 1>dllbuild.prev

D:\tmp\gdal\gdal-3.1.3\port>SET /P PREV_DLLBUILD= 0<dllbuild.prev

D:\tmp\gdal\gdal-3.1.3\port>IF NOT "1" == "1" (ECHO 1 ) 1>dllbuild.prev
        type cpl_config.h.vc.begin > cpl_config.h
        type cpl_config.h.vc.common >> cpl_config.h
        IF NOT "1"=="1"  type cpl_config.h.vc.no_dll >> cpl_config.h
        type cpl_config.h.vc.end >> cpl_config.h
        cl   /nologo .....
```

As you can see, I can not reproduce your problem.

I can also build just inside the port subdirectory without any problems:

```
D:\tmp\gdal\gdal-3.1.3> cd port

D:\tmp\gdal\gdal-3.1.3\port>nmake -f makefile.vc MSVC_VER=1927 WIN64=1
EXT_NMAKE_OPT=D:\tmp\gdal\gdal-3.1.3\nmake.opt.local  clean

Microsoft (R) Program Maintenance Utility Version 14.27.29111.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        del *.obj *.lib cpl_config.h dllbuild.prev

D:\tmp\gdal\gdal-3.1.3\port>nmake -f makefile.vc MSVC_VER=1927 WIN64=1
EXT_NMAKE_OPT=D:\tmp\gdal\gdal-3.1.3\nmake.opt.local

Microsoft (R) Program Maintenance Utility Version 14.27.29111.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        call prev_dllbuild.bat

D:\tmp\gdal\gdal-3.1.3\port>IF NOT EXIST dllbuild.prev (ECHO 1 ) 1>dllbuild.prev

D:\tmp\gdal\gdal-3.1.3\port>SET /P PREV_DLLBUILD= 0<dllbuild.prev

D:\tmp\gdal\gdal-3.1.3\port>IF NOT "1" == "1" (ECHO 1 ) 1>dllbuild.prev
        type cpl_config.h.vc.begin > cpl_config.h
        type cpl_config.h.vc.common >> cpl_config.h
        IF NOT "1"=="1"  type cpl_config.h.vc.no_dll >> cpl_config.h
        type cpl_config.h.vc.end >> cpl_config.h
        cl   /nologo .....
```

I tried all the commands inside "x64 Native Tools Command Prompt for VS 2019",
from the VS 2019 16.7.2

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the gdal-dev mailing list