Compiling method and mysql on OSX

Benjamin Martens bdmartens at
Mon Oct 14 22:42:26 EDT 2013

Ah, fresh air.  I finally was successful, and GnuCash with mysql is working
on my wife's 64-bit macbook pro (OSX 10.68).

Thank you all so much for your help - especially John for attempting my
method to recreate some of the problems I had created, which helped me
 identify my problem.

What ended up being my obstacle, partially self created:
I needed to have the mysql-connector-c that I downloaded (the source code
and headers for mysql) to be the same bit architecture as the build.
Given that I used the pre-packaged dmg from the gnucash website (32 bit), I
needed to have downloaded the 32 bit mysql connector C, and needed to have
ensured that the architecture specified in the .jhbuildrc-custom file
remained as i386.
If anyone wishes to build a 64-bit program, I wish you all the best - I
finally fully gave up on it for the myriad of dependency nightmares.

So no-one else has to try and piece the many individual (and occasionally
misleading, with 'the blind leading the blind') bits of instructions from
the web, I'll include what was my solution below.  If John, Derek, or
others correct it in a following thread, please ignore the methods I

I did apparently needlessly complicate things by downloading the
mysql-connector-c from mysql online, as it seems a version of the mysql.c
and mysql.h is included in this distribution.  Given that I did this, it
was necessary for me to modify
on approx line 54 from      #include <mysql/mysql.h>     to      #include

(As John mentioned, this is due to mysql having changed where they place
the file in the newer versions)

(the first time I was muddling through this, I actually just copied the
file so that it would exist in both locations - messy, but also had been

Now with the correct 32-bit mysql, I was then successfully in running
 jhbuild buildone -f libdbi-drivers

I then needed to copy the produced (found in the
gnucash-stable/lib directory) into
I didn't get the error message John had referred to, however the mysql
option still wasn't appearing in file>open, so I then copied
from the mysql source code I had downloaded, and placed it into

After this, everything worked fine.


A few notes:
Don't bother try set up a 64 bit build unless you're really confident and
willing to spend a lot of time.   Use 32-bit, and ensure the gnucash
package, mysql libraries, and the settings in the .jhbuild-custom all
specify the i386 (32-bit) architecture.

I never did run with the apparently mysql code apparently packaged with
gnucash.  If you do that, you shouldn't really have to modify much at all
in the .jhbuildrc-custom file, other than un-commenting the line about
mysql.  If using this oode, presumably you wouldn't need to modify the
 libdbi-drivers-0.8.3-1/drivers/mysql/dbd_mysql.c     file.

While the documentation states that you don't have to run jhbuild build,
but can run jhbuild build libdbi-drivers right away, I ran into problems
with missing files when I tried this.  You may have to try an initial
jhbuild build     just to get all the required files.  I may have missed
something important with this, but that was my experience.  I'm not sure
how you could get away without installing gtk-osx for this, but I fully
believe it's painfully obvious to those with more experience than me.


On Mon, Oct 14, 2013 at 4:27 PM, Derek Atkins <derek at> wrote:

> On Mon, October 14, 2013 4:02 pm, Benjamin Martens wrote:
> > Tom
> > No, I haven't gone into homebrew, as it I found it would mean
> re-inventing
> > the whole compile process, including coming up with a homebrew compile
> > method for gtk-osx, which looks like a significant undertaking.
> > -Ben
> You don't need gtk-osx to build the libDBI Driver.  The package needs only
> the mysql client library.
> If you find yourself building gtk-osx you are doing something wrong.
> > Please remember to CC this list on all your replies.
> > You can do this by using Reply-To-List or Reply-All.
> -derek
> --
>        Derek Atkins                 617-623-3745
>        derek at   
>        Computer and Internet Security Consultant

More information about the gnucash-user mailing list