example wasm.hh Code running error
Opened this issue · 1 comments
Describe the bug
When I compile hello.cc in the following /lib/c-api/tests/wasm-c-api/example, I find that the header file wasm.hh runs with the error compilation command: g++ -std=c++11 -lstdc++ hello.cc
wasmer -vV; rustc -vV
wasmer 4.2.5 (??????? 2023-12-23)
binary: wasmer-cli
commit-hash:
commit-date: 2023-12-23
host: aarch64-apple-darwin
compiler: cranelift
Steps to reproduce
Change Val to Value and ValType to ValueType in the hello.cc file and compile
g++ -std=c++11 -lstdc++ hello.cc
The compilation failure information is as follows:
Undefined symbols for architecture arm64:
"wasm::ExternType::operator delete(void*)", referenced from:
std::__1::default_deletewasm::FuncType::operator()abi:v15006 const in hello-42dfd6.o
"wasm::Ref::~Ref()", referenced from:
wasm::Value::reset() in hello-42dfd6.o
"wasm::Ref::operator delete(void*)", referenced from:
std::__1::default_deletewasm::Trap::operator()abi:v15006 const in hello-42dfd6.o
std::__1::default_deletewasm::Module::operator()abi:v15006 const in hello-42dfd6.o
std::__1::default_deletewasm::Func::operator()abi:v15006 const in hello-42dfd6.o
std::__1::default_deletewasm::Instance::operator()abi:v15006 const in hello-42dfd6.o
std::__1::default_deletewasm::Extern::operator()abi:v15006 const in hello-42dfd6.o
wasm::Value::reset() in hello-42dfd6.o
"wasm::Func::make(wasm::Store*, wasm::FuncType const*, std::__1::unique_ptr<wasm::Trap, std::__1::default_deletewasm::Trap> (*)(wasm::vecwasm::Value const&, wasm::vecwasm::Value&))", referenced from:
run() in hello-42dfd6.o
"wasm::Func::~Func()", referenced from: ......
Expected behavior
Compile through
Actual behavior
Compilation failure