对于那些像我这样将花费数小时寻找文档,这些标准配置的标志(用于运行的./configure使make install)并
./configure --build is used for specifing the architecture you want to complie for
./configure --host is used to specify the ark of the machine doing the compileing (running xcode)
./configure --target seems to be an alias
现在然后解决问题。
1)获取最新版本的freetds的http://www.freetds.org/
2)下一步是使正常运行freetds的的./configure自己的bash shell文件。你需要两个,因为模拟器是i386/i686架构,苹果设备(iPhone,iPod等)是ARM架构。另外,iPhone开发目录中的编译器文件/版本可能有所不同,只需找到具有逻辑意义并具有类似命名约定的内容即可。 mac主机体系结构随uname -p命令提供。
这是我的建筑上使用的模拟器(I386)build_for_simulator_i386.sh例如:
#!/bin/sh
#unset some shell variables
unset CC
unset CFLAGS
unset CPP
export buildPath=`pwd`
# make i386 (Simulator) target
export CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/i686-apple-darwin11-llvm-gcc-4.2
export CFLAGS="-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk"
# if you want Windows Authentication (NTLM) support you must use at least tds version 7
# the default is 5
./configure --build=i386 --host=i386 --target=i386 --with-tdsver=7.1
实施例用于配置用于ARM汇编(build_for_device_armv7.sh):
#!/bin/sh
# unset some shell variables
unset CC
unset CFLAGS
unset CPP
export buildPath=`pwd`
# make arm target
export CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
export CFLAGS="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk"
export CPP=/usr/bin/cpp
./configure --build=arm-apple-darwin10 --host=x86_64-apple-darwin11.3.0 --target=armv7 --with-tdsver=7.1
3)接下来cd到解压freetds下载导致的根freetds目录,我的freetds_0.91
4)运行你的一个脚本。你只能在一个时间
sh build_for_(desiered build)
this runs ./configure for you with the correct options
(tds version 7 required for NTLM authentication)
5)一旦配置过程完成后,你必须破解的配置文件编译ONE架构。开freetds_0.91 /包含/然后在管线172变化的#define HAVE_ICONV 1到的#define HAVE_ICONV 0
6)如果先前运行的config.h。/ configure,make,make install然后运行这些命令。特别是如果你的交换架构,你会得到运行错误,让没有做这个
sudo make clean
sudo make uninstall
7)执行使用编译使
make all
sudo make install
的化妆过程确实通过故意的一些错误,但如果你看到错误在六或七行的shell提示符下,一旦它返回,就有问题,需要在继续之前修复它们。让我们说在这一点上很多事情可能会出错。
8)安装二进制文件符合这是所有的小.o文件的是freetds的是使/usr/local/lib/libsybdb.a相信我,你不想拉高潮后。 o文件只是你想要的图书馆。将/usr/local/lib/libsybdb.a复制到项目中的相应文件夹中。我所做的是有两个单独的文件夹,每个架构一个,名为“compiled_freetds-0.91_simulator_i386”和“compiled_freetds-0.91_device_armv7”。
9)既然你想让你的生活变得简单,并让Xcode找出使用哪个编译文件,请按照这个步骤的子集来执行动态链接。
a) Select you project settings on the left had side of xcode
(the blue think with the name of your project on it)
b) Select the Target (usual the same name as your app)
c) Navigate to **build settings**, scroll down to **linking > other linker flags**
d) On the left side of Other Linker Flags a mouse over will reveal an expander,
expanding will reveal Debug and Release rows.
e) Add the appriate architectures by selecting the plus on the right side of
either Debug or Release. When the new row appears select the architecture,
double click the first editable field from the right to open an entry box
that you can then drag the appropriate complied file into it to be dynamically
linked. You must do this for both files and when done correctly the file
under ARMv7 will be used when building for the device and the one for Any iOS
Simulator SDK will be used when running on the simulator.
**Note:** You may also need to add the -all_load flag to resolve linking issues.
10)这似乎是避免在设备上运行的代码时涉及libsybdb.5.dylib动态链接错误的问题的最后一步是使卸载。另外,在设备上运行时,您也会收到很多警告,以36为增量,关于CPU_SUBTYPE_ARM_ALL被弃用,这是正常的,但令人讨厌。
sudo make uninstall
我希望这会有所帮助。
这太好了!但我最终通过mobilefoo使用了iSQL SDK。 – Hackmodford 2012-11-04 05:31:12
@AmigableClarkKant这会让事情变得更有意义。 – Tristan 2012-11-16 02:49:59