对于iPhone的MySQL C API库 [英] MySQL C API libraries for iPhone

查看:143
本文介绍了对于iPhone的MySQL C API库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道被编译为ARM架构的iPhone一个MySQL库在哪里?

Does anybody know where to get a MySQL libraries compiled for the arm iPhone architecture?

或为手臂如何交叉编译MySQL?

Or how to cross-compile MySQL for arm?

感谢名单

推荐答案

下面是我是如何做到的:

Here's how I did it:

1)从MySQL下载连接器/ C源$ C ​​$ C版

1) Download the source code version of Connector/C from MySQL

2)下载CMake的(如果你已经安装的MacPorts,键入sudo的港口安装CMake)

2) Download cmake (if you have macports installed, type "sudo port install cmake")

3)<一个获取工具链文件href=\"http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake\" rel=\"nofollow\">http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake

4)在仿真工具链文件,从包含CMAKE_OSX_ARCHITECTURES行删除一个架构

4) In the toolchain file for the simulator, remove one architecture from the line containing CMAKE_OSX_ARCHITECTURES

5)如果你想建立的模拟器,复制缺少的头在/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/netinet/从/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/include/netinet

5) If you want to build for the simulator, copy the missing headers in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/include/netinet/ (ip.h and in_system.h) from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/include/netinet

6)创建一个名为compiled_library的地方目录,例如在桌面上

6) Create a directory called "compiled_library" somewhere, eg on your Desktop

7)调用cmake的是这样的:
cmake的-DCMAKE_TOOLCHAIN​​_FILE = /路径/要/ iPhone的工具链文件-DCMAKE_INSTALL_ preFIX = /路径/要/ compiled_library -DHAVE_FDATASYNC:内部= 0

7) Call cmake like this: cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/iphone-toolchain-file -DCMAKE_INSTALL_PREFIX=/path/to/compiled_library -DHAVE_FDATASYNC:INTERNAL=0

8)请注意,如果你想运行cmake第2个的时候,你可能必须先删除缓存文件

8) Note that if you want to run cmake a 2nd time, you might have to delete the cache file first

9)输入make install

9) type make install

10)现在,你在/路径编译库/到/ compiled_library。通过头文件目录,并libmysql.a复制到你的X code项目添加现有文件...。图书馆应automtically添加到链接器阶段。

10) Now you have the compiled library in /path/to/compiled_library. Copy the header file directory and libmysql.a to your xcode project via "Add existing files...". The library should be automtically added to the linker stage.

11)WOOHOO。使用MySQL C API。

11) WOOHOO. Use the mysql C API.

12)如果这是太多的工作,我目前正在写的iPhone MySQL的包装框架。我有时会发布在未来十年,这里把一个链接。

12) If this is too much work, I'm currently writing a MySQL wrapper framework for the iPhone. I will publish it sometime in the next ten years and put a link here.

编辑:
别人创建的目标C包装为MySQL客户端库:的 http://www.karlkraft.com/index.php/2010/09/17/mysql-for-iphone-and-osx/

这篇关于对于iPhone的MySQL C API库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆