[ocaml-ctypes] Build help

Andre Nathan andre at digirati.com.br
Wed Aug 10 21:20:17 BST 2016


I have working ctypes bindings for MariaDB's libmysqlclient at


I basically copied and adapted the project structure from


to get stub generation working. Currently I'm doing

  let foreign name typ = foreign name typ
    ~from:Dl.(dlopen ~filename:"libmysqlclient.so" ~flags:[RTLD_NOW])

to avoid getting a build error:

  Fatal error: exception
undefined symbol: mysql_server_init")

I'd like to get rid of that, and from googling I found the suggestion of
adding "CCOpt: -Wl,-no-as-needed" (I'm on Ubuntu) to the _oasis file,
but that didn't seem to make a difference.

I'm also not sure if that suggestion if still current, and the
repositories I found on github with a similar structure don't seem to be
using that option. They don't seem to be using the dlopen trick either,
so I'm guessing there's some other way to fix this.

Any help would be greatly appreciated.

Best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ocaml.org/pipermail/ctypes/attachments/20160810/3ba52049/attachment.sig>

More information about the Ctypes mailing list