I have a
myccode.c file of C code which, compiled, produces a
myccode.o object file.
The mymixed_module.ml module uses some “external” C functions defined in
If I do #use"mymixed_module.ml" in my toplevel, I get error message
“The external function `…’ is not available”.
So, how do I tell the toplevel to “load” the myccode.o file ? I noticed
#load"myccode.o" does not work. Perhaps I should add
myccode.o as an argument
when I initially launch
You must use
ocamlmklib -o mylib mymixed_module.cmo mycode.o
You can now
Doesn’t work for me. I did exactly what you suggested, and everything goes as you say, except for the very last step : when I do `#load “mylib.cma” I get the exact same error message, external function … is not available.
Update/correction : it does work after I re-did everything from scratch and restarted the toplevel.