【发布时间】:2016-08-10 17:34:01
【问题描述】:
我最近将我的 OSX 机器升级到 OSX El Capitan (1.11.6),但在编译 GDAL 1.11.x 时遇到了问题。我已经用 1.11.4 和 1.11.5 试过了,我得到了相同的结果。
我们使用 GDAL 1.11.x 作为我们其中一个项目的依赖项——目前我们无法更新到 GDAL 2.x,因为存在遗留软件问题,这些问题与 GDAL 2 中已弃用的某些功能有关.x ...
由于将我的机器移动到 El Capitan,GDAL 1.11.x 无法构建,并在最后的链接步骤中出现以下链接器错误消息:
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C pdf
make[3]: Nothing to be done for `default'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make libgdal.la
/bin/sh /test/gdal-1.11.5/libtool --mode=link g++ -L/opt/local/lib -lgeos_c -lsqlite3 -lpthread -ldl -liconv -L/opt/local/lib -lxml2 -lz -lpthread -liconv -lm -o libgdal.la /test/gdal-1.11.5/frmts/o/*.lo /test/gdal-1.11.5/gcore/*.lo /test/gdal-1.11.5/port/*.lo /test/gdal-1.11.5/alg/*.lo /test/gdal-1.11.5/ogr/ogrsf_frmts/o/*.lo ./ogr/ogrgeometryfactory.lo ./ogr/ogrpoint.lo ./ogr/ogrcurve.lo ./ogr/ogrlinestring.lo ./ogr/ogrlinearring.lo ./ogr/ogrpolygon.lo ./ogr/ogrutils.lo ./ogr/ogrgeometry.lo ./ogr/ogrgeometrycollection.lo ./ogr/ogrmultipolygon.lo ./ogr/ogrsurface.lo ./ogr/ogrmultipoint.lo ./ogr/ogrmultilinestring.lo ./ogr/ogr_api.lo ./ogr/ogrfeature.lo ./ogr/ogrfeaturedefn.lo ./ogr/ogrfeaturequery.lo ./ogr/ogrfeaturestyle.lo ./ogr/ogrfielddefn.lo ./ogr/ogrspatialreference.lo ./ogr/ogr_srsnode.lo ./ogr/ogr_srs_proj4.lo ./ogr/ogr_fromepsg.lo ./ogr/ogrct.lo ./ogr/ogr_opt.lo ./ogr/ogr_srs_esri.lo ./ogr/ogr_srs_pci.lo ./ogr/ogr_srs_usgs.lo ./ogr/ogr_srs_dict.lo ./ogr/ogr_srs_panorama.lo ./ogr/ogr_srs_ozi.lo ./ogr/ogr_srs_erm.lo ./ogr/swq.lo ./ogr/swq_expr_node.lo ./ogr/swq_parser.lo ./ogr/swq_select.lo ./ogr/swq_op_registrar.lo ./ogr/swq_op_general.lo ./ogr/ogr_srs_validate.lo ./ogr/ogr_srs_xml.lo ./ogr/ograssemblepolygon.lo ./ogr/ogr2gmlgeometry.lo ./ogr/gml2ogrgeometry.lo ./ogr/ogr_expat.lo ./ogr/ogrpgeogeometry.lo ./ogr/ogrgeomediageometry.lo ./ogr/ogr_geocoding.lo ./ogr/osr_cs_wkt.lo ./ogr/osr_cs_wkt_parser.lo ./ogr/ogrgeomfielddefn.lo \
-rpath /usr/local/lib \
-no-undefined \
-version-info 19:5:18
libtool: link: g++ -dynamiclib -o .libs/libgdal.1.dylib <snipped out the rest of the gigantic link line/>
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
CPLRecodeIconv(char const*, char const*, char const*) in cpl_recode_iconv.o
CPLRecodeFromWCharIconv(wchar_t const*, char const*, char const*) in cpl_recode_iconv.o
"_iconv_close", referenced from:
CPLRecodeIconv(char const*, char const*, char const*) in cpl_recode_iconv.o
CPLRecodeFromWCharIconv(wchar_t const*, char const*, char const*) in cpl_recode_iconv.o
"_iconv_open", referenced from:
CPLRecodeIconv(char const*, char const*, char const*) in cpl_recode_iconv.o
CPLRecodeFromWCharIconv(wchar_t const*, char const*, char const*) in cpl_recode_iconv.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libgdal.la] Error 1
make: *** [check-lib] Error 2
根据我在 GDAL 网站上找到的文档,我正在做一个minimal configuration:
$ ./configure --with-netcdf=no \
--with-jpeg=no \
--with-threads \
--with-ogr \
--with-geos \
--with-libz=internal \
--with-libtiff=internal \
--with-geotiff=internal \
--without-gif \
--without-pg \
--without-grass \
--without-libgrass \
--without-cfitsio \
--without-pcraster \
--without-png \
--without-gif \
--without-ogdi \
--without-fme \
--without-hdf4 \
--without-hdf5 \
--without-jasper \
--without-ecw \
--without-kakadu \
--without-mrsid \
--without-jp2mrsid \
--without-bsb \
--without-grib \
--without-mysql \
--without-ingres \
--without-xerces \
--without-expat \
--without-odbc \
--without-curl \
--without-dwgdirect \
--without-idb \
--without-sde \
--without-perl \
--without-php \
--without-ruby \
--with-hide-internal-symbols \
--disable-rpath
我正在使用 macports 并安装了 libiconv...
$ sudo port install libiconv
---> Cleaning libiconv
---> Scanning binaries for linking errors
---> No broken files found.
/opt/local/lib 也在我的 LD_LIBRARY_PATH 和 DYLD_LIBRARY_PATH 中,我验证 libiconv 也在 /opt/local/lib 中:
> ll /opt/local/lib/*iconv*
lrwxr-xr-x 1 root admin 16B Jan 29 2016 /opt/local/lib/libiconv.dylib@ -> libiconv.2.dylib
-rw-r--r-- 1 root admin 1.0M Jan 29 2016 /opt/local/lib/libiconv.a
-rw-r--r-- 1 root admin 1.0M Jan 29 2016 /opt/local/lib/libiconv.2.dylib
有没有人遇到过这样的事情?有什么想法吗?
【问题讨论】:
-
你弄明白了吗?
标签: c++ macos osx-elcapitan gdal iconv