ocaml / Zarith

The Zarith library implements arithmetic and logical operations over arbitrary-precision integers and rational numbers. The implementation, based on GMP, is very efficient.
Other
231 stars 70 forks source link

Error Z.t is not compatible with type Big_int.big_int #152

Closed jjttkk closed 8 months ago

jjttkk commented 8 months ago

Hello, while trying to build code, i receive this error message Z.t is not compatible with type Big_int.big_int. Do you know what could be the problem?

antoinemine commented 8 months ago

What code are you building? Where does the error appear?

jjttkk commented 8 months ago

I tried to run this command

parser.mli parser.ml big.ml lexer.ml lib.mli lib.ml cryptobinding.ml derivation.ml generate_ballot.ml 
    ocamlfind ocamlopt  -O3 -o ballot.out  -linkpkg -package str,menhirLib,zarith -I ocaml-java/bin/camljava camljava.cmxa -ppx ocaml-java/bin/ocaml-java-ppx parser.mli parser.ml big.ml lexer.ml lib.mli lib.ml cryptobinding.ml derivation.ml generate_ballot.ml

on this github repositoryhttps://github.com/jjttkk/schulze.

antoinemine commented 8 months ago

You are confusing two different libraries that use different data-types: bignum (Big_int.big_int) and Zarith (Z.t). You should call Zarith functions only on Z.t and bignum functions only on Big_int.big_int. Preferably, you should only use one of the libraries and not mix them.

This is not an issue with Zarith, but with your code, so I am closing the ticket.