OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.86k stars 2.53k forks source link

fatal error C1083: 无法打开包括文件: “proj.h” #1619

Closed 874656645 closed 5 years ago

874656645 commented 5 years ago

Expected behavior and actual behavior.

I expected to be able to compel gdal 3.0 with vs2015 by nmake(I set PROJ_INCLUDE and PROJ_LIBRARY path in nmake.opt already), but I get this:

cl: 命令行 warning D9024 :无法识别的源文件类型“D:\OSGeo4W\include”,假定为对象文件
cl: 命令行 warning D9027 :源文件“D:\OSGeo4W\include”被忽略
cl: 命令行 warning D9024 :无法识别的源文件类型“D:\OSGeo4W\include”,假定为对象文件
cl: 命令行 warning D9024 :无法识别的源文件类型“D:\OSGeo4W\include”,假定为对象文件
cl: 命令行 warning D9027 :源文件“D:\OSGeo4W\include”被忽略
cl: 命令行 warning D9027 :源文件“D:\OSGeo4W\include”被忽略
gdalapplyverticalshiftgrid.cpp
f:\opensourceproject\gdal-3.0.0\alg\gdalapplyverticalshiftgrid.cpp(39): fatal error C1083: 无法打开包括文件: “proj.h”: No such file or directory

Does anyone know what is going on or who can tell me where the problem is if I'm doing wrong?

Thank you very much.

Steps to reproduce the problem.

gdal-3.0.0\alg\gdalapplyverticalshiftgrid.cpp(39)

Operating system

Win 10 64 bit

GDAL version and provenance

The 3.0.0 version from https://gdal.org/download.html

rouault commented 5 years ago

You need to build against PROJ 6, which OSGeo4W delivers in \apps\proj-dev subdirectory of its install

874656645 commented 5 years ago

You need to build against PROJ 6, which OSGeo4W delivers in \apps\proj-dev subdirectory of its install

Yeah, I know and I have built it. The version is proj-6.1.0 from https://proj.org/download.html.

Do you have any clue?

MinluLi commented 5 years ago

You need to build against PROJ 6, which OSGeo4W delivers in \apps\proj-dev subdirectory of its install

Yeah, I know and I have built it. The version is proj-6.1.0 from https://proj.org/download.html.

Do you have any clue?

你要先编译PROJ,然后修改gdal里面的nmake.opt文件,将里面的proj的路径改成你编译的proj的路径。

Anzai1028 commented 5 years ago

You need to build against PROJ 6, which OSGeo4W delivers in \apps\proj-dev subdirectory of its install

Yeah, I know and I have built it. The version is proj-6.1.0 from https://proj.org/download.html. Do you have any clue?

你要先编译PROJ,然后修改gdal里面的nmake.opt文件,将里面的proj的路径改成你编译的proj的路径。

# PROJ stuff (required dependency: PROJ >= 6) PROJ_INCLUDE = "F:\02_Projects\03_osgearth2.10.1VS2017X64\03_proj\include" PROJ_LIBRARY = "F:\02_Projects\03_osgearth2.10.1VS2017X64\03_proj\lib\proj_6_2.lib"

我这样修改之后还是报错

cl: 命令行 warning D9024 :无法识别的源文件类型“F:\02_Projects\03_osgearth2.10.1VS2017X64\03_proj\include”,假定为对象文件 cl: 命令行 warning D9027 :源文件“F:\02_Projects\03_osgearth2.10.1VS2017X64\03_proj\include”被忽略 cl: 命令行 warning D9024 :无法识别的源文件类型“F:\02_Projects\03_osgearth2.10.1VS2017X64\03_proj\include”,假定为对象文件 cl: 命令行 warning D9024 :无法识别的源文件类型“F:\02_Projects\03_osgearth2.10.1VS2017X64\03_proj\include”,假定为对象文件 cl: 命令行 warning D9027 :源文件“F:\02_Projects\03_osgearth2.10.1VS2017X64\03_proj\include”被忽略 cl: 命令行 warning D9027 :源文件“F:\02_Projects\03_osgearth2.10.1VS2017X64\03_proj\include”被忽略 gdalapplyverticalshiftgrid.cpp f:\02_projects\03_osgearth2.10.1vs2017x64\00_sourcecodes\gdal301\alg\gdalapplyverticalshiftgrid.cpp(39): fatal error C1083: 无法打开包括文件: “proj.h”: No such file or directory NMAKE : fatal error U1077: “"D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.EXE"”: 返回代码“0x2” Stop. NMAKE : fatal error U1077: “"D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.EXE"”: 返回代码“0x2” Stop.

jiyahan commented 2 years ago

PROJ_INCLUDE = "F:\02_Projects\03_osgearth2.10.1VS2017X64\03_proj\src"