MySQL++ on Mac using MAMP
Typical install… like there is such a thing! I sat down eager to take MySQL++ for a test-drive, so I opened up a few Safari tabs, shuttling between the MySQL and MySQL++ sites (the library has been taken over by a caring individual), and sipped my large glass of water. Everything went along smashingly until configure complained that it couldn’t find the MySQL library and include files. Oh yeah, I’m using MAMP, so I don’t have any! This was the solution:
- Download MySQL++ from here.
- Unarchive MySQL++.
- Download closest compatible MySQL version (5.0.77 at time of writing) here.
- Unarchive MySQL
- Open a terminal window
- cd /path/to/MySQL++
- ./configure ./configure –with-mysql-lib=/path-to-wherever-you-unarchived-mysql/lib –with-mysql-include=/path-to-wherever-you-unarchived-mysql/include –prefix=/path/where/you/want/mysql++/installed
- make
- sudo make install
- Revel in installation success
Update: when I tried to build and run one of the sample programs in xcode, I got a “Signal 10″ bus error – but only in debug builds (release were fine)! After an hour lost in the www woods, I started manually flipping all the target settings that were different and found that the preprocessor macro “-D_GLIBCXX_DEBUG=1″ was the problem. Of course, once I knew what I was looking for, I found it in two seconds on the web. You can read a more detailed description of the problem here. Once I removed the macro, all was well.
Update #2: the library tries to find the mySQL server in the default location, not wherever MAMP’s mySQL server is. One solution, which I found here, is to put a symbolic link in the place where the library looks, which points to the real file in MAMP.