[plt-scheme] Load-extension troubles

From: David Van Horn (dvanhorn at cs.brandeis.edu)
Date: Wed Jan 9 16:07:38 EST 2008

This is not really a PLT Scheme question but more of a Unix question.

I have a library that uses the C FFI.  It uses mysql.h at compile time 
and libmysqlclient at run time.  I compile as follows:

 > mzc \
++ccf -I/usr/src/apps/mysql-4.0.13/include/ \
++cppf -I/usr/src/apps/mysql-4.0.13/include/ \
--auto-dir mysqlclient.ss
mzc v371 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
  [output to "./compiled/native/i386-linux/3m/mysqlclient.so"]

OK, now I want to use it:

 > mzscheme -L mysqlclient.ss foo
Welcome to MzScheme v371 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
load-extension: couldn't open 
undefined symbol: mysql_fetch_field)

My environment has the following in it, which is where libmysqlclient.so 
is located:


And, the offending symbol is defined:

nm $LD_LIBRARY_PATH/libmysqlclient.so | grep 'mysql_fetch_field$'
00006960 T mysql_fetch_field

Does anyone have clues as to what incantation I need to get this off the 

Thanks in advance,

Posted on the users mailing list.