Compiling method and mysql on OSX

Benjamin Martens bdmartens at gmail.com
Wed Oct 9 21:28:24 EDT 2013


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.

----

Thanks for your help with sorting out the mysql connection.

-Ben


On Fri, Oct 4, 2013 at 10:30 AM, Derek Atkins <warlord at mit.edu> wrote:

> Hi,
>
> Benjamin Martens <bdmartens at gmail.com> writes:
>
> > Thanks Derek and John for your previous replies.
> >
> > I finally got some time on the Mac again, and again am running into
> problems.
> >  I've caved, and pasted the output from my terminal application at the
> bottom,
> > and hopefully someone can point me to what I'm missing.  I have the
> feeling
> > this should be straight forward and am missing something obvious.  I
> keep on
> > getting errors that make it seem like either a lot of configuration
> options /
> > scripts are wrong, I'm missing some common dependency, or I haven't set a
> > variable in the .jhbuildrc-custom file correctly.
> >
> > My mySQL portion of the .jhbuild-custom file is the only portion I've
> > modified, and it is:
> > #If you wish to enable the mysql backend, uncomment the lines below.
> > #MySQL requires CMake 2.6.0 or later to build, so the libmysql module
> > #has a dependency on cmake which will be built by default. If you
> > #already have CMake installed on the path, add "skip.append("cmake")
> > #somewhere in this file.
> > #skip.append("cmake")
> > _gc_module=modules[-1]
> > modules[-1]="mysql"
> > modules.append(_gc_module)
> > module_extra_env["mysql"] = { "CMAKE_INSTALL_PREFIX":  prefix }
> > append_autogenargs("libdbi-drivers", "--with-mysql --with-mysql-incdir="
> +
> > prefix + "/mysql-connector-c/include --with-mysql-libdir=" + prefix + "/
> > mysql-connector-c/lib")
> >
> > As you can see, I pasted the mysql-connector-c files into the
> gnucash-stable
> > directory, and have the include and lib directories correct within that,
> I
> > believe.
>
> I'm not sure what mysql-connector has to do with anything.  You need the
> mysql client libraries available.
>
> [snip]
>
> > Making all in mysql
> >
> > /bin/sh ../../libtool  --tag=CC   --mode=compile
> /Developer/usr/bin/gcc-4.2
> > -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I/Users/macuser/
> > gnucash-stable/include -I/Users/macuser/gnucash-stable/mysql-connector-c/
> > include  -I/Users/macuser/gnucash-stable/include -I/Developer/SDKs/
> > MacOSX10.6.sdk/usr/include  -arch x86_64
> -I/Developer/SDKs/MacOSX10.6.sdk/usr/
> > include -isysroot /Developer/SDKs/MacOSX10.6.sdk
> -mmacosx-version-min=10.6 -MT
> > dbd_mysql.lo -MD -MP -MF .deps/dbd_mysql.Tpo -c -o dbd_mysql.lo
> dbd_mysql.c
> >
> > libtool: compile:  /Developer/usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I.
> -I../.. -I..
> > /.. -I../../include -I/Users/macuser/gnucash-stable/include
> -I/Users/macuser/
> > gnucash-stable/mysql-connector-c/include -I/Users/macuser/gnucash-stable/
> > include -I/Developer/SDKs/MacOSX10.6.sdk/usr/include -arch x86_64
> -I/Developer
> > /SDKs/MacOSX10.6.sdk/usr/include -isysroot /Developer/SDKs/MacOSX10.6.sdk
> > -mmacosx-version-min=10.6 -MT dbd_mysql.lo -MD -MP -MF
> .deps/dbd_mysql.Tpo -c
> > dbd_mysql.c  -fno-common -DPIC -o .libs/dbd_mysql.o
> >
> > dbd_mysql.c:54:25: error: mysql/mysql.h: No such file or directory
> >
> > dbd_mysql.c:111: error: expected ')' before '*' token
> >
> > dbd_mysql.c: In function 'dbd_connect':
> [snip]
>
> And this proves the issue; you don't have the mysql C library available.
>
> I have no idea why configure passed.
>
> But this begs the question:  Why are you using jhbuild to do this
> instead of something else that you're more familiar with?
>
> -derek
>
> --
>        Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>        Member, MIT Student Information Processing Board  (SIPB)
>        URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>        warlord at MIT.EDU                        PGP key available
>


More information about the gnucash-user mailing list