mysql - 使用 xcode 编译基本的 mysql c 代码

标签 mysql objective-c xcode

有人设法编写使用 mysqlclient 库的代码吗?我可以编译工作但不能链接:(

XCode 产生以下输出:

Build TestMysql of project TestMysql with configuration Debug

Ld build/Debug/TestMysql normal x86_64
cd /Users/jacob/Documents/cocoa/TestMysql
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Developer/usr/bin/gcc-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk
   -L/Users/jacob/Documents/cocoa/TestMysql/build/Debug -L/usr/local/mysql/lib
   -L/usr/local/mysql-5.1.38-osx10.5-x86_64/lib
   -F/Users/jacob/Documents/cocoa/TestMysql/build/Debug -filelist /Users/jacob/Documents/cocoa/TestMysql/build/TestMysql.build/Debug/TestMysql.build/Objects-normal/x86_64/TestMysql.LinkFileList
   -mmacosx-version-min=10.5 -lm -lz -lmysqlclient -lmygcc "
" -framework CoreFoundation -o /Users/jacob/Documents/cocoa/TestMysql/build/Debug/TestMysql

i686-apple-darwin10-gcc-4.2.1: 
: No such file or directory
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1

是的,我已经了解 mysql/cocoa 框架,我正在编写必须在 os/x 和 linux 上编译的代码。讽刺的是,我只花了 20 分钟就搞清楚如何编写一个 make 文件来编译、链接和运行 Objective-C/mysql 代码,但 xcode 却复杂得多。

最佳答案

我相信“”字符串让您感到悲伤 - 特别是因为错误消息的文件名是空字符串。

替代方法: 您是否考虑过只使用您在 XCode 中制作的 Makefile?

文件->新项目->其他->外部构建系统。

Apple 文档介绍了此方法:http://bit.ly/dYNuR

关于mysql - 使用 xcode 编译基本的 mysql c 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1480253/

相关文章:

xcode - 在 Xcode 中消除 "Documentation issue"警告?

php - php if 语句的奇怪问题

Objective-C:打印枚举值

Python 2.7 和 MySQL : grooming tuple

iphone - 使用 UICollectionViewFlowLayout 在 UICollectionView 的第一项上进行左填充

iphone - xcode 解析或读取加载到 webview 中的 html 内容

ios - 在 Master-Detail 应用程序中为 Master/Detail View Controller 重用 UIViewController(带有 UITableView)?

ios - : and ()之间的swift iOS区别

php - 在Mysql php中一次连续搜索多个单词

mysql - 在 NodeJS 中扩展 MySQL 查询函数之外的变量