Compiling method and mysql on OSX

Benjamin Martens bdmartens at gmail.com
Mon Oct 14 00:04:43 EDT 2013


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?)

(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)
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
  Referenced from:
/Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdmysql.so
  Expected in: flat namespace




On Wed, Oct 9, 2013 at 10:57 PM, John Ralls <jralls at ceridwen.us> wrote:

>
> On Oct 9, 2013, at 6:28 PM, Benjamin Martens <bdmartens at gmail.com> wrote:
>
> > Hi Derek (& John),
> >
> > Thanks for your reply.  I've now compiled the libdbimysql.so file,
> placed it in the Applications/Gnucash.app/Contents/Resources/lib/dbd/
> directory of the osx intel package installation, yet still am unable to see
> mysql as an option in the open menu.  Do you have any suggestions for where
> to look for troubleshooting this?
> >
> >
> > ---
> > With respect to the actual compilation of the libdbimysql.so file and
> what had been going wrong before (as best as I can tell):
> >
> > Unfortunately I am not familiar with any OSX compilers, and have only
> minimally kept up my coding / compiling skills for the past decade as I
> have been very busy in my very much unrelated work field.
> >
> > Anyway,
> > I did place the mysql libraries in the directories I mentioned, and
> looking back at the areas you snipped, the mysql.h was in the
> ...mysql-connector-c/include folder (mysql-connector-c is the package
> containing the c libraries for/from mysql).
> >
> > In fact, a line stated:
> > checking for MySQL support... yes: libs in
> /Users/macuser/gnucash-stable/mysql-connector-c/lib, headers in
> /Users/macuser/gnucash-stable/mysql-connector-c/include
> >
> > It looks, though, that it is the dbd_mysql.c file that refers to a
> different location for the mysql.c file (mysql/mysql.c).  This dbd_mysql.c
> is part of the libdbi-drivers-0.8.3-1 package for gtk-osx, and looking at
> the dbd_mysql.c contents, on the referred line 54, it has "#include
> <mysql/mysql.h>
> >
> > I copied the mysql.c and mysql.h files from the
> mysql-connector-c/include & lib directories to the
> libi-drivers-0.8.3-1/mysql directory, and was successful at building the
> libdbdmysql.so file.  I placed it in the
> Gnucash.app/Contents/Resources/lib/dbd/ folder and installed it according
> to the quartz build document, with no errors displayed.
>
> The most likely problem is that you didn't specify -arch i386 when you
> built libdbdmysql.so (shouldn't be libdbimysql). That specifies 32-bit,
> which I build because we're supporting older systems. An architecture
> mismatch will prevent the loadable module from loading.
>
> The other thing to check is
>   otool -L
> /Applications/Gnucash.app/Contents/Resources/lib/dbd/libdbdmysql.so
> examine the results and make sure that every dependency is on the
> specified path.
> (If you put Gnucash.app somewhere else, adjust the path as needed.)
>
> Regards,
> John Ralls
>
>
>


More information about the gnucash-user mailing list