Use dune to link with c library

I’m trying to compile a project that uses a native . so library. I’ve written an ocaml wrapper for it and added foreign_stub to dune file, but it yields undefined reference errors during linking. How to fix that? I tried adding flags -cclib -llib but that doesn’t seem to change anything.

In general, I would suggest you provide more details about your issue (Dune files, error message, build comands, reproduction instructions, etc) if you are hoping to get help with it.

Using -cclib -l<libname> is probably part of the solution, but is hard to say without more details.