Last 5 comments
31 years ago
Rafael:  Thank you very much, I was having a huge headache to solve the very same problem!
37 years ago
Ray:  Having the same problem. Very frustrating. Luckily, for some reason my released version worked on the iPad itself, but now I can't get it to run in the simulator. Getting no such table, which I'm guessing is an initialization error. Will continue to investigate.
38 years ago
Jeremy:  FYI, I've just tried it with the SQLite 3.7.0 preview and the same problem occurs.
Also, I'm not using any extra third-party libraries with my SQLite, so the problem isn't your Unicode extension.
38 years ago
Jeremy:  I'm having the same problem with compiling SQLite against iOS 4 for the iPad simulator, but in my case it works fine running on an actual iPad (also works in the iPhone simulator and on an iPod Touch).
Same problem with 3.6.23.1, 3.6.23, and at least back to 3.6.21. Compiling against iOS 3.2 makes it work, though that's not really an option for iPhone (as opposed to iPad) apps.
I have no idea what to do about it or how big a problem it really is...
38 years ago
Pascal:  The problem seems to have deep roots, however there is a solution, see the updated post. :)
The archive
March 2011  (1)
July 2010  (1)
July 2009  (1)
March 2009  (1)
July 2008  (3)
June 2008  (1)
May 2008  (3)
March 2008  (1)
July 2007  (1)
June 2007  (3)
May 2007  (1)
April 2007  (1)
July 2006  (2)
June 2006  (6)

Cocoa Framework For MySQL - Build MCPKit As Universal Binary

Monday, July 28th 2008 - 15:21
Using the MCPKit is one way to use MySQL from your Cocoa Application, and I decided to do just that. But there is that one problem since the project seems not to be all that alive - the compiled version is PPC only, no Universal Binary. Well, I thought, download the source and build the Framework on your own. I finally succeeded, but not without running into some troubles first.

This is a quick rundown on what to do to compile the MCPKit_bundled as a Universal Binary and make it independent from an installed mysqld on the Mac your App should run on. I merely concat the ideas gathered at different locations here, props where props are due, and this is at the following URLs:

myztik.katan.com/?p=197
www.osxentwicklerforum.de/thread.php?threadid=5110

I seem to be missing something since this makes the MCPKit run flawlessly, but only as long MySQL is locally installed...


Compile MCPKit_bundled

  • Download the source MCPKit_src from here (I used Version 3.0.1 as of this writing)
  • Delete (or move) the contents of MCPKit_src/mysql-local/lib; we will place our own UB Libraries there in a minute
  • Create the missing files MCPKit/MCPKit_bundled-Info.plist and MCPKit/MCPKit_prefix.pch, easiest is by copying it from another project and ajdusting MCPKit_bundled-Info.plist
  • Download MySQL Sources from here (I picked the GNU TAR archive for MySQL 5.0.51b)
  • From within Terminal, navigate into the mysql-folder and configure the source with the following environment variables and flags:
  • MACOSX_DEPLOYMENT_TARGET=10.5 \ CFLAGS='-O3 -fno-omit-frame-pointer -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \ LDFLAGS='-arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \ CXXFLAGS='-O3 -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64 -fno-omit-frame-pointer -fno-rtti' \ ./configure \ --prefix=/usr/local/mysql \ --disable-dependency-tracking \ --enable-thread-safe-client \ --enable-local-infile \ --with-mysqld-user=_mysql \ --with-zlib-dir=/usr \ --with-archive-storage-engine \ --with-csv-storage-engine \ --with-federated-storage-engine \ --enable-dtrace \ --with-openssl
    (Props to cmittendorf for this one)
  • make your own MySQL (will take a while)
  • Find the libraries libmysqlclient.dylib and libmysqlclient.a in mysql-5.0.51b/libmysql/.libs. Copy these into the lib-folder we previously emptied: MCPKit_src/mysql-local/lib
  • Now we're ready to launch Xcode, so open MCPKit.xcodeproj
  • Click on "Targets" » "MPCKit_bundled" and open the Info Panel
  • Make sure ppc as well as i386 are active
  • Click Build. It should compile, although with a respectable amount of warnings

After that, build the target MCPKit_bundled in a Release configuration and add it as a framework to your project as described in the documentation of MCPKit (PDF) (Mirrored » here).
Jonno at 12.10.2008 02:58

Do you know if the libmysql or MCPKit works on the iphone?
Pascal at 12.10.2008 09:54

I haven't checked, but more important is - does MySQL run on the iPhone? I think SQLite is enough since you won't run a server on your iPhone, MySQL would be overkill.
Jonno at 13.10.2008 03:40

thanks for the reply. I want to write a simple application that retrieves status data from a mysql database.
Pascal at 14.10.2008 10:33

Ah, the iPhone retrieves data from a mysql database on a remote server? Sounds interesting, would be great if you keep me posted on your progress. :-)
SRav at 19.01.2009 19:31

Can it be compiled with Garbage Collection on?
Pascal at 19.01.2009 20:34

I haven't tried. And I still fail to really produce a version independent of locally installed MySQL, sadly...
Comments are disabled