realworldocaml / book

V2 of Real World OCaml
https://dev.realworldocaml.org
Other
1.19k stars 175 forks source link

FFI sample code build issue #3543

Open gruntguo opened 2 years ago

gruntguo commented 2 years ago

I am a beginer of ocaml, when I build the example, follow the sample(ffi chapters), get following error. then I made a change in dune , it works; not sure if it is my env issue or something else. Thanks for the book

file: +++ book/book/foreign-function-interface/examples/ffi/ncurses/dune

error: +++ 3 | (libraries ctypes-foreign.threaded) ^^^^^^^^^^^^^^^^^^^^^^^ Error: Library "ctypes-foreign.threaded" not found.

diff 
+++
$ diff dune.orig  dune
3c3
<   (libraries ctypes-foreign.threaded)
---
>   (libraries ctypes.foreign)
yminsky commented 2 years ago

The book was out of date with how ctypes is now packaged and how it's invoked via Dune. Take another look!