Installing ocaml API for Z3 using opam
I want to use Z3 in my OCaml program. Using opam, I did $ opam install z3 $ eval $(opam env) then tried compiling with $ ocamlfind ocamlopt -o main -package z3 -linkpkg main.ml What I get is a huge dump of thousands of In function foo undefined reference to bar , starting with /home/andrepd/.opam/4.06.1+flambda/lib/z3/libz3-static.a(api_datatype.o): In function `mk_datatype_decl': api_datatype.cpp:(.text+0x4bf): undefined reference to `__cxa_allocate_exception' api_datatype.cpp:(.text+0x522): undefined reference to `__cxa_throw' api_datatype.cpp:(.text+0x57b): undefined reference to `__cxa