yallop / ocaml-ctypes

Library for binding to C libraries using pure OCaml
MIT License
363 stars 95 forks source link

Error: `Unbound module Type_description` against `libmdbsql` #720

Closed abhillman closed 1 year ago

abhillman commented 1 year ago

Error

 % dune build
 File "bin/libmdbsql__type_gen.ml", line 4, characters 12-34:
4 |     (module Type_description.Types)
                ^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module Type_description
File "bin/libmdbsql__function_gen__Function_description__Functions.ml", line 9, characters 14-44:
9 |       (module Function_description.Functions)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module Function_description

Other stuff

# dune version
% dune --version
3.6.1

# available system packages
% pkg-config --list-all
gthread-2.0           GThread - Thread support for GLib
gmodule-2.0           GModule - Dynamic module loader for GLib
gmodule-export-2.0    GModule - Dynamic module loader for GLib
libffi                libffi - Library supporting Foreign Function Interfaces
zlib                  zlib - zlib compression library
gobject-2.0           GObject - GLib Type, Object, Parameter and Signal Library
gio-2.0               GIO - glib I/O library
gmodule-no-export-2.0 GModule - Dynamic module loader for GLib
libmdbsql             libmdbsql - libmdb based SQL engine
libmdb                libmdb - core MDB file support library
glib-2.0              GLib - C Utility Library
gio-unix-2.0          GIO unix specific APIs - unix specific headers for glib I/O library

# ocaml library versions
% echo "#list;;" | dune utop                                                                nix-shell
Done: 60% (3/5, 2 left) (jobs: 0)OCaml version 4.14.0
Enter #help;; for help.

# bigarray            (version: [distributed with Ocaml])
bigarray-compat     (version: 1.1.0)
bytes               (version: [distributed with OCaml 4.02 or above])
compiler-libs       (version: [distributed with Ocaml])
compiler-libs.bytecomp (version: [distributed with Ocaml])
compiler-libs.common (version: [distributed with Ocaml])
compiler-libs.native-toplevel (version: [distributed with Ocaml])
compiler-libs.optcomp (version: [distributed with Ocaml])
compiler-libs.toplevel (version: [distributed with Ocaml])
ctypes              (version: 0.20.0)
ctypes.foreign      (version: 0.20.0)
ctypes.stubs        (version: 0.20.0)
ctypes.top          (version: 0.20.0)
dune                (version: n/a)
dune.configurator   (version: 3.6.1)
dynlink             (version: [distributed with Ocaml])
findlib             (version: 1.9.6)
findlib.dynload     (version: 1.9.6)
findlib.internal    (version: 1.9.6)
findlib.top         (version: 1.9.6)
integers            (version: n/a)
integers.top        (version: n/a)
lambda-term         (version: 3.2.0)
logs                (version: 0.7.0)
logs.browser        (version: 0.7.0)
logs.cli            (version: 0.7.0)
logs.fmt            (version: 0.7.0)
logs.lwt            (version: 0.7.0)
logs.threaded       (version: 0.7.0)
logs.top            (version: 0.7.0)
lwt                 (version: 5.6.1)
lwt.unix            (version: 5.6.1)
lwt_log             (version: dev)
lwt_log.core        (version: dev)
lwt_react           (version: 1.1.5)
mew                 (version: n/a)
mew_vi              (version: n/a)
ocamldoc            (version: [distributed with Ocaml])
ocplib-endian       (version: n/a)
ocplib-endian.bigstring (version: n/a)
react               (version: 1.2.2)
react.top           (version: 1.2.2)
repro               (version: n/a)
result              (version: 1.5)
stdlib              (version: [distributed with Ocaml])
stdlib-shims        (version: 0.3.0)
str                 (version: [distributed with Ocaml])
threads             (version: [distributed with Ocaml])
threads.none        (version: [internal])
threads.posix       (version: [internal])
trie                (version: n/a)
uchar               (version: distributed with OCaml 4.03 or above)
unix                (version: [distributed with Ocaml])
utop                (version: 2.10.0)
uucp                (version: 15.0.0)
uuseg               (version: 15.0.0)
uuseg.string        (version: 15.0.0)
uutf                (version: 1.0.3)
zed                 (version: n/a)

# %  

# uname  
% uname -a
Darwin mbp.local 22.1.0 Darwin Kernel Version 22.1.0: Tue Sep 27 22:07:43 PDT 2022; root:xnu-8792.41.6~5/RELEASE_ARM64_T8103 arm64

Repro

https://github.com/abhillman/dune-ctools-mdbtools

yallop commented 1 year ago

This isn't a ctypes issue. Your dune file says that you have a functor called Type_description, but there isn't such a functor in your code. The instructions in the dune manual` explain which files you need to create.