3

我一直在尝试为 iOS 构建静态 armv7 和 i386 Graphviz 库。我几乎遵循了每个教程,并最终设法构建了这两个库。我将每个 i386 *.a 库文件复制到 Xcode 中的文件夹中。我对每个 *.a armv7 文件和每个 *.h 头文件都做同样的事情。我的问题是 Xcode 抛出未找到符号的错误。关于为什么找不到符号的任何想法?

Undefined symbols for architecture armv7:
  "_drawGraph", referenced from:
      -[FNETGraph render] in FNETGraph.o
  "_createGraph", referenced from:
      -[FNETGraph render] in FNETGraph.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是我为 armv7 配置和制作的代码:

export DEV_iOS=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
export SDK_iOS=${DEV_iOS}/SDKs/iPhoneOS6.1.sdk
export COMPILER_iOS=${DEV_iOS}/usr/bin

export CC=${COMPILER_iOS}/gcc
export CPP=${COMPILER_iOS}/llvm-cpp-4.2
export CXX=${COMPILER_iOS}/g++
export CXXCPP=${COMPILER_iOS}/g++
export OBJC=${COMPILER_iOS}/gcc
export LD=${COMPILER_iOS}/ld

export LDFLAGS="-arch armv7 -isysroot ${SDK_iOS}"
export CFLAGS="${LDFLAGS} -miphoneos-version-min=6.1"
export CXXFLAGS="${LDFLAGS} -miphoneos-version-min=6.1 -fvisibility-inlines-hidden"
export CXXCPPFLAGS="${LDFLAGS} -miphoneos-version-min=6.1"
export OBJCFLAGS="${LDFLAGS} -miphoneos-version-min=6.1 -fvisibility-inlines-hidden"

export AR=${COMPILER_iOS}/ar
export AS=${COMPILER_iOS}/as
export NM=${COMPILER_iOS}/nm
export CXXCPP=${COMPILER_iOS}/llvm-cpp-4.2
export RANLIB=${COMPILER_iOS}/ranlib

./configure --host=arm-apple-darwin11 
            --disable-dependency-tracking 
            --enable-shared=no 
            --enable-static=yes 
            --enable-ltdl-install=no 
            --enable-ltdl=no 
            --enable-swig=no 
            --enable-tcl=no 
            --with-codegens=no 
            --with-fontconfig=no 
            --with-freetype2=no 
            --with-ipsepcola=yes 
            --with-libgd=no 
            --with-quartz=yes 
            --with-visio=yes 
            --with-x=no 
            --with-cgraph=yes

make
touch lib/gvpr/gdefs.h
make

mkdir -p ~/Desktop/Graphiz/armv7
find . -name '*.a' -execdir cp '{}' ~/Desktop/Graphiz/armv7 \;

mkdir -p ~/Desktop/Graphiz/headers
find . -name '*.h' -execdir cp '{}' ~/Desktop/Graphiz/headers \;
4

0 回答 0