ontio / ontology-go-sdk

SDK for Ontology
24 stars 44 forks source link

Build error #139

Open lynAzrael opened 2 years ago

lynAzrael commented 2 years ago

This is my test code

package main

import (
    "fmt"
    sdk "github.com/ontio/ontology-go-sdk"
)

func main() {
    sdkClient := sdk.NewOntologySdk()
    sdkClient.NewRpcClient().SetAddress("http://dappnode1.ont.io:20336")
    height, err := sdkClient.GetCurrentBlockHeight()
    if err != nil {
        fmt.Printf("get current block height failed, err: %s\n", err.Error())
        return
    }
    fmt.Printf("current block height is %d\n", height)
}

It returns some error info where I try to build the project.

# ontSdk
/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: warning: ignoring file /Users/lilin/go/pkg/mod/github.com/ontio/ontology@v1.14.1-alpha/smartcontract/service/wasmvm/libwasmjit_onto_interface_darwin.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_wasmjit_bytes_destroy", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_bytes_destroy in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_bytes_destroy)
  "_wasmjit_chain_context_create", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_chain_context_create in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_chain_context_create)
  "_wasmjit_construct_result", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_construct_result in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_construct_result)
  "_wasmjit_get_exec_step", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_get_exec_step in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_get_exec_step)
  "_wasmjit_get_gas", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_get_gas in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_get_gas)
  "_wasmjit_invoke", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_invoke in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_invoke)
  "_wasmjit_service_index", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_service_index in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_service_index)
  "_wasmjit_set_calloutput", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_set_calloutput in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_set_calloutput)
  "_wasmjit_set_exec_step", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_set_exec_step in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_set_exec_step)
  "_wasmjit_set_gas", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_set_gas in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_set_gas)
  "_wasmjit_validate", referenced from:
      __cgo_d02b16eeae27_Cfunc_wasmjit_validate in 000019.o
     (maybe you meant: __cgo_d02b16eeae27_Cfunc_wasmjit_validate)
ld: symbol(s) not found for architecture arm64
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)