ld: symbol(s) not found for architecture arm64
go install github.com/CosmWasm/wasmvm/api
# github.com/CosmWasm/wasmvm/api
ld: warning: ignoring file ../../golang/pkg/mod/github.com/!cosm!wasm/[email protected]/api/libwasmvm.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_analyze_code", referenced from:
__cgo_10a41752a67f_C2func_analyze_code in _x004.o
__cgo_10a41752a67f_Cfunc_analyze_code in _x004.o
(maybe you meant: __cgo_10a41752a67f_C2func_analyze_code, __cgo_10a41752a67f_Cfunc_analyze_code )
"_destroy_unmanaged_vector", referenced from:
__cgo_10a41752a67f_Cfunc_destroy_unmanaged_vector in _x006.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_destroy_unmanaged_vector)
"_execute", referenced from:
__cgo_10a41752a67f_C2func_execute in _x004.o
__cgo_10a41752a67f_Cfunc_execute in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_execute, __cgo_10a41752a67f_C2func_execute )
"_get_metrics", referenced from:
__cgo_10a41752a67f_C2func_get_metrics in _x004.o
__cgo_10a41752a67f_Cfunc_get_metrics in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_get_metrics, __cgo_10a41752a67f_C2func_get_metrics )
"_ibc_channel_close", referenced from:
__cgo_10a41752a67f_C2func_ibc_channel_close in _x004.o
__cgo_10a41752a67f_Cfunc_ibc_channel_close in _x004.o
(maybe you meant: __cgo_10a41752a67f_C2func_ibc_channel_close, __cgo_10a41752a67f_Cfunc_ibc_channel_close )
"_ibc_channel_connect", referenced from:
__cgo_10a41752a67f_C2func_ibc_channel_connect in _x004.o
__cgo_10a41752a67f_Cfunc_ibc_channel_connect in _x004.o
(maybe you meant: __cgo_10a41752a67f_C2func_ibc_channel_connect, __cgo_10a41752a67f_Cfunc_ibc_channel_connect )
"_ibc_channel_open", referenced from:
__cgo_10a41752a67f_C2func_ibc_channel_open in _x004.o
__cgo_10a41752a67f_Cfunc_ibc_channel_open in _x004.o
(maybe you meant: __cgo_10a41752a67f_C2func_ibc_channel_open, __cgo_10a41752a67f_Cfunc_ibc_channel_open )
"_ibc_packet_ack", referenced from:
__cgo_10a41752a67f_C2func_ibc_packet_ack in _x004.o
__cgo_10a41752a67f_Cfunc_ibc_packet_ack in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_ibc_packet_ack, __cgo_10a41752a67f_C2func_ibc_packet_ack )
"_ibc_packet_receive", referenced from:
__cgo_10a41752a67f_C2func_ibc_packet_receive in _x004.o
__cgo_10a41752a67f_Cfunc_ibc_packet_receive in _x004.o
(maybe you meant: __cgo_10a41752a67f_C2func_ibc_packet_receive, __cgo_10a41752a67f_Cfunc_ibc_packet_receive )
"_ibc_packet_timeout", referenced from:
__cgo_10a41752a67f_C2func_ibc_packet_timeout in _x004.o
__cgo_10a41752a67f_Cfunc_ibc_packet_timeout in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_ibc_packet_timeout, __cgo_10a41752a67f_C2func_ibc_packet_timeout )
"_init_cache", referenced from:
__cgo_10a41752a67f_C2func_init_cache in _x004.o
__cgo_10a41752a67f_Cfunc_init_cache in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_init_cache, __cgo_10a41752a67f_C2func_init_cache )
"_instantiate", referenced from:
__cgo_10a41752a67f_C2func_instantiate in _x004.o
__cgo_10a41752a67f_Cfunc_instantiate in _x004.o
(maybe you meant: __cgo_10a41752a67f_C2func_instantiate, __cgo_10a41752a67f_Cfunc_instantiate )
"_load_wasm", referenced from:
__cgo_10a41752a67f_C2func_load_wasm in _x004.o
__cgo_10a41752a67f_Cfunc_load_wasm in _x004.o
(maybe you meant: __cgo_10a41752a67f_C2func_load_wasm, __cgo_10a41752a67f_Cfunc_load_wasm )
"_migrate", referenced from:
__cgo_10a41752a67f_C2func_migrate in _x004.o
__cgo_10a41752a67f_Cfunc_migrate in _x004.o
(maybe you meant: __cgo_10a41752a67f_C2func_migrate, __cgo_10a41752a67f_Cfunc_migrate )
"_new_unmanaged_vector", referenced from:
__cgo_10a41752a67f_Cfunc_new_unmanaged_vector in _x006.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_new_unmanaged_vector)
"_pin", referenced from:
__cgo_10a41752a67f_C2func_pin in _x004.o
__cgo_10a41752a67f_Cfunc_pin in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_pin, __cgo_10a41752a67f_C2func_pin )
"_query", referenced from:
__cgo_10a41752a67f_C2func_query in _x004.o
__cgo_10a41752a67f_Cfunc_query in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_query, __cgo_10a41752a67f_C2func_query )
"_release_cache", referenced from:
__cgo_10a41752a67f_Cfunc_release_cache in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_release_cache)
"_reply", referenced from:
__cgo_10a41752a67f_C2func_reply in _x004.o
__cgo_10a41752a67f_Cfunc_reply in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_reply, __cgo_10a41752a67f_C2func_reply )
"_save_wasm", referenced from:
__cgo_10a41752a67f_C2func_save_wasm in _x004.o
__cgo_10a41752a67f_Cfunc_save_wasm in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_save_wasm, __cgo_10a41752a67f_C2func_save_wasm )
"_sudo", referenced from:
__cgo_10a41752a67f_C2func_sudo in _x004.o
__cgo_10a41752a67f_Cfunc_sudo in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_sudo, __cgo_10a41752a67f_C2func_sudo )
"_unpin", referenced from:
__cgo_10a41752a67f_C2func_unpin in _x004.o
__cgo_10a41752a67f_Cfunc_unpin in _x004.o
(maybe you meant: __cgo_10a41752a67f_Cfunc_unpin, __cgo_10a41752a67f_C2func_unpin )
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
查看 wasmvm 源代码后发现他们是通过 CI 自动构建的方式把各个平台和架构的动态链接库放到源代码仓库中的方式进行分发的(这样并不是很通用化,可能对于 Linux 的不同 CPU 架构或是 macOS 的不同 CPU 架构就没办法正确构建了),可以通过: