Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception for Assemblyscript #3448

Open
spino17 opened this issue May 20, 2024 · 1 comment
Open

Exception for Assemblyscript #3448

spino17 opened this issue May 20, 2024 · 1 comment

Comments

@spino17
Copy link

spino17 commented May 20, 2024

I build the .wasm binary by following the official link: https://www.assemblyscript.org/getting-started.html#setting-up-a-new-project. My code in /assembly/index.ts is

// The entry file of your WebAssembly module.

export function main(): void {
  console.log("Hello, world");
}

or even if I try:

console.log("Hello, world");

when I try command iwasm release.wasm, I am getting the following error:

[13:26:38:790 - 1ED737AC0]: failed to check signature '(i)' and resolve pointer params for import function (env abort)

[13:26:38:818 - 1ED737AC0]: warning: failed to link import function (env, console.log)
[13:26:38:820 - 1ED737AC0]: warning: failed to link import function (env, abort)

#00: 0x0000 - console.log
#01: 0x013e - $f2

WASM module instantiate failed: Exception: failed to call unlinked import function (env, console.log)
@wenyongh
Copy link
Contributor

Hi, maybe you can refer to the assembly-script sample in wamr-app-framework repo:
https://github.com/bytecodealliance/wamr-app-framework/tree/main/assembly-script

Here it defines Console APIs for console.log and console.log_number, which are implemented in:
https://github.com/bytecodealliance/wamr-app-framework/blob/main/assembly-script/wamr_app_lib/console.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants