GDAL使用mingw编译问题

发布于 2021-12-01 04:59:46 字数 2592 浏览 860 评论 2

编译的时候总是提示找不到头文件

在window下使用tdm-mingw编译64位的程序。

在cygwin下使用./configure --prefix=/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/build --with-libz=yes --with-libtiff=yes --with-geotiff=yes --with-jpeg=yes  --enable-shared --enable-static --with-liblzma=yes --build=x86_64-w64-mingw32

生成makefile。让使用mingw32-make进行编译。然后就报下面的错误了

mingw32-make[1]: Entering directory 'D:/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/gcore'
C:/TDM-GCC-64/bin/mingw32-make -C mdreader
mingw32-make[2]: Entering directory 'D:/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/gcore/mdreader'
C:/cygwin64/bin/sh.exe /cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/libtool --mode=compile --tag=CXX g++ -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/port -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/gcore -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/alg -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/ogr -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/ogr/ogrsf_frmts -g -O2  -Wall  -DOGR_ENABLED -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/port  -DGDAL_COMPILATION -c -o ../reader_digital_globe.lo reader_digital_globe.cpp
libtool: compile:  g++ -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/port -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/gcore -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/alg -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/ogr -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/ogr/ogrsf_frmts -g -O2 -Wall -DOGR_ENABLED -I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/port -DGDAL_COMPILATION -c reader_digital_globe.cpp  -DDLL_EXPORT -DPIC -o ../.libs/reader_digital_globe.o
In file included from reader_digital_globe.h:34:0,
                 from reader_digital_globe.cpp:31:
../gdal_mdreader.h:35:22: fatal error: cpl_port.h: No such file or directory
compilation terminated.



这里可以看到编译参数中有  
-I/cygdrive/d/development_library/GDAL/gdal-2.0.2-mingw64/gdal_2/gdal-2.0.2/port

可是还是找不到头文件,这是为什么呢?


如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

睫毛上残留的泪 2021-12-01 12:15:25

等我下周试试。谢谢啦

终止放荡 2021-12-01 10:33:22

我也是同样的问题,按照这个方法又出现了以下问题 mingw32-make[1]: *** No rule to make target 'gcore/gdal? gdaldrivermanager.cpp -o gdaldrivermanager.lo', needed by 'libgdal.la'. Stop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文