Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 521

Problem with linking the `ssl` lib on macos

$
0
0

Hi,

I’m trying to use the ocaml-ssl lib (GitHub - savonet/ocaml-ssl: OCaml SSL bindings.) in a project on macos.
I installed it with opam install ssl (no problem during installation).

However, I doesn’t build.

Minimal .ml file:

let () = 
Ssl.init();
print_endline "Hello, World!"

Dune file:

(executable
 (public_name test2)
 (name main)
 (libraries test2 ssl))

I get this error:

File "bin/dune", line 3, characters 7-11:
3 |  (name main)
           ^^^^
ld: warning: directory not found for option '-L/opt/homebrew/Cellar/openssl@3/3.1.0/lib'
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
File "caml_startup", line 1:
Error: Error during linking (exit code 1)

I seem to understand that the compiler can’t find the open-ssl directory, but the path in the error message is the right one and has a bunch of files that look legit inside.

Does anyone know how to make it compile, and can you explain what is failing here please?

6 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 521

Trending Articles