OCamlPro / freeton_wallet

The 'ft' tool is a multi-account terminal wallet for the Free TON blockchain. It is based on the freeton_ocaml_sdk.
https://ocamlpro.github.io/freeton_wallet
Other
14 stars 9 forks source link

libfreeton_ocaml_sdk : Undefined symbols for architecture arm64 #82

Closed arozovyk closed 2 years ago

arozovyk commented 2 years ago

I'm trying to build the project with
opam exec -- dune build @install --ignore-promoted-rules (--ignore-promoted-rules) is there to avoid the issue of pgsql instance not running on my system (apparently not critical at the moment)

I get errors of "Undefined symbols for architecture arm64:" in libfreeton_ocaml_sdk.a.

freeton_ocaml_sdk version is 0.4.5 installed from opam ocp repo.

Full error : link_error.txt

Any ideas why this is occurring?

arozovyk commented 2 years ago

I figured it out.

This is MacOS specific linkage issue that happend when linking to freeton_ocaml_sdk that's not built correctly.

It is fixed by adding -framework CoreFoundation -framework Security flags to c_library_flags in src/freeton_ocaml_sdk/dune.

Short term fix for people stumbling upon this is to use

opam pin freeton_ocaml_sdk git@github.com:arozovyk/freeton_ocaml_sdk.git

before building the wallet. Long term we should find a way to specify the flags depending on system (since -framework flag is not compatible with Linux for instance).

lefessan commented 2 years ago

From what I see in the doc, you can use this expression to check for mac os x (within a (if COND X Y) expression):

(= %{ocamlc-config:system} macosx)
lefessan commented 2 years ago

(if does not exist in dune... :-( So, I am trying using an include file that is modified by opam on macosx...