AntelopeIO / eos-vm

Other
6 stars 10 forks source link

hello_driver.cpp - "no mapping for imported function" #9

Open mikelik opened 1 year ago

mikelik commented 1 year ago

When I compile and run hello_driver.cpp and removing memset from the example I get the error that: no mapping for imported function for at least 3 functions:

Exception is thrown from eosio/vm/host_function.hpp:463.

Used leap v3.2.3, CDT v3.2.0.

Example output if I remove try catch from hello_driver.cpp:

mikel@msi:~/repo/eos-vm/build/tools$  ./hello-driver 1 2 3
terminate called after throwing an instance of 'eosio::vm::wasm_link_exception'
  what():  wasm linked function failure
Aborted (core dumped)
mikelik commented 1 year ago

@larryk85 created a workaround here: https://github.com/larryk85/examples-for-eos-vm

Basically, above functions are implemented and mapped in the example contract. In the long term, we need to fix the above issue, so the user doesn't have to map those functions.

This issue should be solved when https://github.com/AntelopeIO/cdt/issues/189 will be done.