用cygwin编译gdal遇到的,用vs2017编译就没有该问题。
In file included from cpl_json.cpp:32:
./cpl_json_header.h:36:10: fatal error: 'json.h' file not found
对比发现,在cygwin中缺少包含的头文件-I../frmts/zlib -I../ogr/ogrsf_frmts/geojson/libjson,其实不是这个原因,是下面语句中路径里包含了/cygdrive/e,比如-I/cygdrive/e/osg-osgearth-source/other_3rdParty/gdal-2.3.2/alg -I/cygdrive/e/osg-osgearth-source/other_3rdParty/gdal-2.3.2/ogr -I/cygdrive/e/osg-osgearth-source/other_3rdParty/gdal-2.3.2/ogr/ogrsf_frmts -I/cygdrive/e/osg-osgearth-source/other_3rdParty/gdal-2.3.2/gnm -I/cygdrive/e/osg-osgearth-source/other_3rdParty/gdal-2.3.2/apps等。
/bin/sh /cygdrive/e/osg-osgearth-source/other_3rdParty/gdal-2.3.2/libtool --mode=compile --silent --tag=CXX D:/android-ndk-r19c/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android28-clang++ -I/cygdrive/e/osg-osgearth-source/other_3rdParty/gdal-2.3.2/port -I/cygdrive/e/osg-osgearth-source/other_3rdParty/gdal-2.3.2/gcore -I/cygdrive/e/osg-osgearth-source/other_3rdParty/gdal

在使用Cygwin编译GDAL时遇到'json.h'文件未找到的错误,而使用VS2017则没有此问题。错误源于编译命令中的路径包含了'/cygdrive/e',导致找不到头文件。通过修改GDALmake.opt,将GDAL_ROOT的路径改为不包含'/cygdrive/e'的形式,如'e:/osg-osgearth-source/other_3rdParty/gdal-2.3.2',可以解决这个问题。
最低0.47元/天 解锁文章
1528

被折叠的 条评论
为什么被折叠?



