Search code examples
c++visual-studiovisual-studio-2017gdal

Error building GDAL: PROJ_INCLUDE should be defined. PROJ >= 6 is a required dependency


I am trying to get GDAL 3.0.1 to work. Generating the Visual Studio 2017 project was a piece of cake, all I needed was to run generate_vcxproj.bat. But now I'm getting an error on this line of makefile.vc:

!IF !DEFINED(PROJ_INCLUDE)
!ERROR PROJ_INCLUDE should be defined. PROJ >= 6 is a required dependency
!ENDIF

What's that all about? If I am meant to define PROJ_INCLUDE, what value should it have? Is that even preprocessor define?


Solution

  • The error is confusing because PROJ sounds like shortened "project". But it is, in fact, a dependency on the PROJ library. I installed it through OSGeo as recommended in installation instructions.

    After that, fill in the paths to installed libs into nmake.opt:

    # PROJ stuff (required dependency: PROJ >= 6)
    PROJ_INCLUDE = -IC:\OSGeo4W64\proj
    PROJ_LIBRARY = C:\OSGeo4W64\lib\proj_5_2.lib