0

我正在尝试从这里安装 postgis

我运行以下命令

cd /Downloads/postgis-2.3.1
configure
make 

错误是

postgis_topology.c:1427:13: warning: format specifies type 'unsigned int' but the argument has type 'uint64' (aka 'unsigned long') [-Wformat]
            SPI_processed, numelems);
            ^~~~~~~~~~~~~
postgis_topology.c:1484:13: warning: format specifies type 'unsigned int' but the argument has type 'uint64' (aka 'unsigned long') [-Wformat]
            SPI_processed, numelems);
            ^~~~~~~~~~~~~
postgis_topology.c:1542:13: warning: format specifies type 'unsigned int' but the argument has type 'uint64' (aka 'unsigned long') [-Wformat]
            SPI_processed, numelems);
            ^~~~~~~~~~~~~
postgis_topology.c:1907:59: warning: format specifies type 'int' but the argument has type 'uint64' (aka 'unsigned long') [-Wformat]
                cberror(topo->be_data, "processed %d rows, expected 1", SPI_processed);
                                                  ~~                    ^~~~~~~~~~~~~
                                                  %lu
4 warnings generated.
clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  -bundle -multiply_defined suppress -Wl,-undefined,dynamic_lookup -o postgis_topology-2.3.so postgis_topology.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -Wl,-dead_strip_dylibs   ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a  -L/opt/local/lib  -lgeos_c -lproj  -ljson-c -L/opt/local/lib -lxml2 -lz -lpthread -liconv -lm -L/usr/local/Cellar/sfcgal/1.3.0_2/lib -lSFCGAL   -L/usr/local/Cellar/sfcgal/1.3.0_2/lib -lSFCGAL -bundle_loader /usr/local/Cellar/postgresql/9.6.2/bin/postgres
---- Making all in loader
/bin/sh ../libtool --mode=link \
      gcc -I ../liblwgeom -g -O2  -fno-common -DPIC  -Wall -Wmissing-prototypes    shpopen.o dbfopen.o getopt.o shpcommon.o safileio.o shp2pgsql-core.o shp2pgsql-cli.o ../liblwgeom/liblwgeom.la -o shp2pgsql -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -Wl,-dead_strip_dylibs   -liconv
libtool: link: gcc -I ../liblwgeom -g -O2 -fno-common -DPIC -Wall -Wmissing-prototypes shpopen.o dbfopen.o getopt.o shpcommon.o safileio.o shp2pgsql-core.o shp2pgsql-cli.o -o .libs/shp2pgsql -Wl,-dead_strip_dylibs  ../liblwgeom/.libs/liblwgeom.dylib -L/opt/local/lib -lgeos_c -lproj -ljson-c -L/usr/local/Cellar/sfcgal/1.3.0_2/lib -lSFCGAL -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -liconv
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _utf8 in shp2pgsql-core.o
  "_iconv_close", referenced from:
      _utf8 in shp2pgsql-core.o
  "_iconv_open", referenced from:
      _utf8 in shp2pgsql-core.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]: *** [shp2pgsql] Error 1
make: *** [all] Error 1

如何解决此错误?

4

0 回答 0