Compiling method and mysql on OSX

John Ralls jralls at ceridwen.us
Mon Oct 14 01:53:38 EDT 2013


On Oct 13, 2013, at 9:04 PM, Benjamin Martens <bdmartens at gmail.com> wrote:

> Hi John,
> I went back and re-compliled the mysql driver as i386 with the -f (force) option (needed to make it actually compile again), and replaced the driver in the expected /Applications/Gnucash.app/Contents/Resources/lib/dbd/
> 
> Gnucash starts, and I am able to select the mysql option.  Unfortunately after entering the information, gnucash crashes with the below information.  Do you have any further suggestions on how to proceed?   I looked at the date stamp on the libdbdmysql.so , and it did appear to be the new, therefore i386 version.  In looking back through the compile comments, though, it looks like there were several items noted to have been made for a different architecture (ie, mysql and many others that appeared to be components of gtk-osx)
> 
> Is there a reason why the libdbmysql.so driver cannot be supplied/distributed?  (ie, legal with respect to the mysql c and headers?)
Cannot? No. It's in the Windows package, and I'm pretty sure you can get it through MacPorts as well. But there's nowhere near enough demand to make it worth my time to maintain it in the MacOSX bundle: You're the third person in 4 years who's asked, and one of the others wanted Postgres, not MySql.

> 
> (given this headache, I went back and tried to compile a 64 bit version, and was eventually able to make it to step 38/72, but kept on getting obscure unhanded exception / missing files (that are not missing and and are where they are expected) - so I left that end alone.  Perhaps it is because development has happened for 32 bit architectures.)
> 
> FYI, the output from otool was apparently normal/appropriate:
> otool -L /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdmysql.so/Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdmysql.so:

> 	/Users/macuser/gnucash-stable/lib/libdbi.0.dylib (compatibility version 1.0.0, current version 1.5.0)
> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)

No, it's not. Where's libmysqlclient.dylib?

> macintosh:dbd
> 
> 
> 
> Thanks for your help!
> -Ben
> --
> 
> 
> Process:         Gnucash-bin [37163]
> Path:            /Applications/Gnucash.app/Contents/MacOS/Gnucash-bin
> Identifier:      org.gnucash.Gnucash
> Version:         2.4.13 (2.4.13)
> Code Type:       X86 (Native)
> Parent Process:  launchd [93]
> 
> Date/Time:       2013-10-13 23:42:50.530 -0400
> OS Version:      Mac OS X 10.6.8 (10K549)
> Report Version:  6
> 
> Interval Since Last Report:          206968 sec
> Crashes Since Last Report:           3
> Per-App Interval Since Last Report:  3592 sec
> Per-App Crashes Since Last Report:   2
> Anonymous UUID:                      C14F170B-9FAF-4C65-94C7-04EAB19BFD9C
> 
> Exception Type:  EXC_BREAKPOINT (SIGTRAP)
> Exception Codes: 0x0000000000000002, 0x0000000000000000
> Crashed Thread:  0  Dispatch queue: com.apple.main-thread
> 
> Dyld Error Message:
>   Symbol not found: _mysql_init

This comes from libmysqlclient,dylib, which isn't listed by otool -L, hence the linkage failure.

>   Referenced from: /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdmysql.so
>   Expected in: flat namespace

In sum, the problem is pretty obvious. The reason behind it is probably buried in the compile and link output. You could try adding the path to libmysqlclient.dylib to DYLD_LIBRARY_PATH in /Applications/Gnucash.app/Contents/MacOS/Gnucash, but it's possible based on the otool -L output that the linker doesn't even know to look for it.

Note that libmysqlclient.dylib must also have a 32-bit image in it, or it won't link with libdbdmysql.so.

Regards,
John Ralls






More information about the gnucash-user mailing list