views:

94

answers:

3

I have developed an iPhone application which needs to access MySQL database on the server. It builds very well on 'iPhone simulator',but when I want to build 'Device' version, it fails with error messages bolow:

ld: warning: in /usr/local/mysql/lib/libmysqlclient.dylib, file was built for i386 which is not the architecture being linked (armv6)

ld: warning: in /usr/local/mysql/lib/libmygcc.a, file was built for unsupported file format which is not the architecture being linked (armv6)

Is it unreachable to access MySQL from iPhone? Or MySQL server library is wrong?

A: 

The library that you are trying to link is not for iPhone. Have you checked this question?

taskinoor
I downloaded and copyed the libmysqlclient.a to my project and build it,but it seems dosen't work.
im not sure. havnt tried it myself. someone in the same question said that u cant use mysql directly.
taskinoor
A: 

Yes, you just need to grab the mysql connector for C and compile it for armv6 and armv7. If you don't want to go through the trouble, you can grab the Objective-C connector for Mysql that I have written and either use the Objective-C API, or just use included .a file which will work on OSX or iOS.

Karl Kraft
A: 

Hi Karl,

Can you please give an example as to how I use your API in the project?

Hema