7

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?

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778

2 Answers2

11

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
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • I did it as described. It started building, but then I received the "proj.h" No such file or directory message. – Roger Almengor Jan 29 '21 at 18:16
  • @RogerAlmengor I do not remember how I managed to compile the whole thing. What I do remember is that there were many more issues and it took me 5 hours to get it working. But check the other answer, maybe the path in mine is wrong. – Tomáš Zato Jan 29 '21 at 20:22
  • thank you very much for your answer. I started building a GDAL application using VS Code (see this post: https://lazyadminblog.blogspot.com/2018/07/how-to-build-gdal-from-source-for.html.). But when I ran my application I received the following message: Th following program cannot be executed, becase gdal302_d.dll was not found (or something along this lines, I have a german version and this is a quick and dirty translation from the original message). In the message it is stated that by reinstalling gdal the problem might be solved. However it did not happen that way. – Roger Almengor Jan 31 '21 at 12:55
  • Can someone give an updated answer for the PROJ version? Right now if you install OSGeo4 there is no /proj directory and there is also no proj_x_x.lib file – justanotherguy Oct 12 '22 at 16:14
  • @justanotherguy I certainly cannot. Just seeing your reply made me sad because I remembered that trying to build this project took so much of my energy that even after I finally made it, I no longer had any energy to do what I wanted to do with it. – Tomáš Zato Oct 12 '22 at 19:21
  • That's unfortunate. The latest OSGeo4 installation doesn't include any of the files mentioned in the answers in this post. I guess I'll have to keep digging. – justanotherguy Oct 12 '22 at 19:46
3

If I could've comment, it would be one:

I think, you gave an incorrect Include path:

PROJ_INCLUDE = -IC:\OSGeo4W64\include

would be the correct one. Also it claims, it needs PROJ version >=6, but it's 5.2 if I'm not mistaken. Didn't you had problems with inclusion of proj_experimental.h?

Bgnr
  • 31
  • 3