2

我正在尝试从源代码构建底图工具包,以便 matplotlib 在 OS X 10.8 下的 MacBook Pro 上运行。C 和 C++ 编译器包含在最新的 Xcode 包中。该包包括geos-3.3.3 包,需要在构建主底图python 包之前单独构建和安装。当我使用提供的 Makefile 执行此操作时,当 makefile 尝试构建 libgeos.dylib 库时出现以下错误:

Undefined symbols for architecture x86_64:
  "std::auto_ptr<geos::geom::Envelope>::auto_ptr(std::auto_ptr_ref<geos::geom::Envelope>)", referenced from:
      virtual thunk to geos::geom::GeometryCollection::computeEnvelopeInternal() constin libgeom.a(GeometryCollection.o)
  "__ZNSt8auto_ptrIN4geos4geom8EnvelopeEEcvSt12auto_ptr_refIT_EIS2_EEv", referenced from:
      virtual thunk to geos::geom::GeometryCollection::computeEnvelopeInternal() constin libgeom.a(GeometryCollection.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

在使用 gcc 4.7 的 Fedora 17 机器上,这个库可以成功构建,因此 Mac 编译器/链接器显然有问题。但是,我不知道如何解码此消息。例如,什么是“虚拟重击”?关于如何在 Mac 上编译和构建它的任何见解?

4

1 回答 1

1

我使用了不同的编译器,问题就消失了。尝试:

使 CXX=c++

为我工作。OSX 10.8.3,XCode 4.6.1。

于 2013-04-15T01:31:57.003 回答