You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openCtypesopenForeignlet test = foreign "foo" (void @-> returning void)
Type dune build && dune install.
Then create a new project with dune init proj --kind=executable test with the following bin/dune:
(executable
(public_name test)
(name main)
(libraries test foo))
and the following bin/main.ml:
openFoolet()= test ()
Type dune exec test and see the following error:
File "bin/dune", line 3, characters 7-11:
3 | (name main)
^^^^
/usr/bin/ld: cannot find lib/support.o: No such file or directory
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking (exit code 1)
Is there a way to tell Dune to link support.o with the executable? If I call Foo.test from within foo's tests, everything seems to work fine.
(This is a continuation of my attempt to use a library with foreign C code.)
Run
dune init proj --kind=library foo
. Put the followingsupport.c
file inlib/
:lib/dune
must look as follows:lib/Foo.ml
must be:Type
dune build && dune install
.Then create a new project with
dune init proj --kind=executable test
with the followingbin/dune
:and the following
bin/main.ml
:Type
dune exec test
and see the following error:Is there a way to tell Dune to link
support.o
with the executable? If I callFoo.test
from withinfoo
's tests, everything seems to work fine.Specifications
My OS is Ubuntu 22.04 jammy (x86_64 Linux 6.5.0-28-generic).
The text was updated successfully, but these errors were encountered: