命令行库构建因链接器错误而失败

And*_*ent 5 graphviz ios5 xcode4.3

我正在使用脚本在Xcode 4.3中使用Xcode 4.3构建GraphViz当前版本(2012年6月7日)时发现库未找到错误.我可能犯了错误,更新构建脚本来自其他人对Xcode4.3的新位置和Applications文件夹中的开发人员工具的成功配方.

ld: library not found for -lcrt1.10.6.o

(从内存中执行此操作,因此CRT lib上的确切数字可能是错误的)

我也有点迷失了如何将它合并到IDE中的Xcode构建中.我是一个非常有经验的程序员,但有时很难找到Xcode 4.(几十年的Visual Studio等).

我复制了之前这个问题的说明并进行了改编

#!/bin/sh
# For iPhoneOS, see http://clang.llvm.org/ for options
export DEV_iOS=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
# was /Developer/Platforms/iPhoneOS.platform/Developer
export SDK_iOS=${DEV_iOS}/SDKs/iPhoneOS5.1.sdk
export COMPILER_iOS=${DEV_iOS}/usr/bin
export CC=${COMPILER_iOS}/clang
export CXX=${COMPILER_iOS}/clang++
export LDFLAGS="-arch armv7 -pipe -Os -gdwarf-2 -mthumb -isysroot ${SDK_iOS}"
export CFLAGS="${LDFLAGS}"
export OBJCFLAGS="${LDFLAGS}"
export CXXFLAGS="${LDFLAGS} -fvisibility-inlines-hidden"
export LD=${COMPILER_iOS}/ld
export CPP=${COMPILER_iOS}/clang
export AR=${COMPILER_iOS}/ar
export AS=${COMPILER_iOS}/as
export NM=${COMPILER_iOS}/nm
export CXXCPP="${COMPILER_iOS}/clang++"
export OBJC=${COMPILER_iOS}/clang
export RANLIB=${COMPILER_iOS}/ranlib

./configure \
--build=arm-apple-darwin11 \
--host=arm-apple-darwin11 \
--disable-dependency-tracking \
--enable-shared=no \
--enable-static=yes \
--enable-ltdl=no \
--enable-swig=no \
--enable-tcl=no \
--srcdir=${GVROOT} \
--with-codegens=no \
--with-cgraph=no \
--with-graph=yes \
--with-expat=no \
--with-fontconfig=no \
--with-freetype2=no \
--with-ipsepcola=yes \
--with-libgd=no \
--with-quartz=yes \
--with-visio=yes \
--with-x=no
Run Code Online (Sandbox Code Playgroud)

N_A*_*N_A 0

如果我没记错的话,这就是解决库未找到问题的方法。

CFLAGS="$(OTHER_CFLAGS) -miphoneos-version-min=5.0"
LDFLAGS="$(OTHER_LDFLAGS) --miphoneos-version-min=5.0"
Run Code Online (Sandbox Code Playgroud)

要将其链接到 Xcode,在“构建设置”下的“标头和库搜索路径”下,您需要添加库和标头的构建版本的路径。

您可以将构建脚本添加为 Xcode 项目的一部分,但我在这方面还没有取得成功,而且您应该只需要每个版本构建一次,因此将时间投入到构建脚本以外的任何内容中都不需要很多回报。

如果您决定无论如何将脚本放入项目中(祝您好运!),请转到“构建阶段”选项卡,添加“运行脚本”类型的构建阶段并将脚本粘贴到此处。