Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctypes-foreign name issue #3214

Open
arnau opened this issue Nov 4, 2019 · 2 comments
Open

ctypes-foreign name issue #3214

arnau opened this issue Nov 4, 2019 · 2 comments
Assignees

Comments

@arnau
Copy link
Contributor

arnau commented Nov 4, 2019

The Foreign Function Interface chapter uses the ctypes-foreign library, installed using opam install ctypes-foreign. So far so good.

When using the library though, the examples use #require "ctypes-foreign" for utop and ctypes-foreign.threaded for dune:

(executable
   (name      ncurses)
   (libraries ctypes-foreign.threaded))

Which leads to the following error:

$ dune build ncurses.exe
File "dune", line 3, characters 13-36:
3 |   (libraries ctypes-foreign.threaded))
                 ^^^^^^^^^^^^^^^^^^^^^^^
Error: Library "ctypes-foreign.threaded" not found.
Hint: try: dune external-lib-deps --missing ncurses.exe

If instead I use ctypes.foreign.threaded it works fine.

I tried to fix the book but then the tests fail. I suspect it's because the ctypes version in the duniverse folder is out of date?

@avsm
Copy link
Member

avsm commented Nov 5, 2019

This is because there's a working snapshot of ctypes (from yallop/ocaml-ctypes#588) in that chapter at the moment. I'll work out these rough edges with the threaded/unthreaded variants over the next few weeks as that gets ready to merge upstream.

@avsm avsm self-assigned this Nov 5, 2019
@peter-jerry-ye
Copy link

Hello,

I came across the same issue the other day and I found this issue is still open.

May I ask if there's going to be an update? Because it can be misleading if one were following the example from scratch instead of cloning directly the book.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants