Re: CLSQL-MYSQL on Lispworks for OSX

Alexandre Paes <[email protected]> Sat, 22 Sep 2012 01:22:10 +0100
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
Hi Kevin,

Although you were right that I was mixing 64-bit mysql with 32-bit Lispworks that alone is not the answer. :P I still get the same error but...
I did notice however that if, after the error I perform the following:

1. abort the operation
2.  open ~/quicklisp/dists/quicklisp/software/clsql-20120909-git/db-mysql/mysql-client-info.lisp
3. evaluate the form

    (uffi:def-function ("mysql_get_client_info" mysql-get-client-info)
      ()
    :module "mysql"
    :returning :cstring)

   *** This is the first statement inside the (eval-when (:compile-toplevel :load-toplevel :execute) block

3. retry loading clsql-mysql with:

   CL-USER> (ql:quickload "clsql-mysql")

Then the library loads perfectly fine and everything works, I can then connect and perform queries without a problem.
Any idea why on earth this might be happening? It doesn't make any sense to me.

Best regards,
Alexandre Paes



On Sep 21, 2012, at 8:09 PM, Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> wrote:

> On Sep 17, 2012, at 6:40 PM, Alexandre Paes <[email protected]> wrote:
>> I'm having a slight problem when trying to load clsql-mysql on lispworks in OSX.
>> ...
>> CL-USER> (push #p"/usr/local/mysql/lib/" clsql-sys:*foreign-library-search-paths*)
>> (#P"/usr/local/mysql/lib/" #P"/Users/user/quicklisp/dists/quicklisp/software/clsql-20120520-git/db-
>> mysql/" #P"/Users/user/quicklisp/dists/quicklisp/software/clsql-20120520-git/uffi/")
>> ...
>> Error: Undefined function MYSQL:MYSQL-GET-CLIENT-INFO in form (SYMBOL-FUNCTION MYSQL:MYSQL-GET-CLIENT-INFO).
> 
> Hi Alexandre,
> 
> I suspect that you might have incompatible bit-width (32 or 64) versions of Lispworks and the MySQL library you installed in /usr/local/mysql/lib/.
> 
> For example, on my OSX system, I use 64-bit versions of Lisp along with a 64-bit version of the mysql library installed by MacPorts. You can use the 'file' command to help you.
> 
> kevin@gazelle:~$ file /usr/local/bin/sbcl
> /usr/local/bin/sbcl: Mach-O 64-bit executable x86_64
> 
> kevin@gazelle:~$ file /opt/local/lib/mysql55/mysql/libmysqlclient.dylib 
> /opt/local/lib/mysql55/mysql/libmysqlclient.dylib: Mach-O 64-bit dynamically linked shared library x86_64
> 
> Kevin
>