Open ku6ryo opened 3 years ago
I tried running Wasm3DotNet on Unity 2020.3.0f1, but could not reproduce the problem.
I think this crash happened because version of managed and native library were not matched.
Could you build both wasm3.dll
(native) and Wasm3DotNet.dll
(managed) using same version of this repository, then copy both DLLs into Unity?
By the way, the Environment
object has to be retained during using any functionalities of wasm3.
So it is better to move the variable environment
in your code from an using
statement to a field.
For example:
public class Foo : MonoBehaviour
{
Wasm3DotNet.Wrapper.Environment environment;
Runtime runtime;
public void Start()
{
environment = new Wasm3DotNet.Wrapper.Environment();
runtime = new Runtime(environment);
var module = runtime.ParseModule(wasm);
module.LinkRawFunction("externals", "print_add", "i(ii)", LogInt);
runtime.LoadModule(module);
var func = runtime.FindFunction("test");
func.Call(10);
}
}
OK, thank you for checking. I will try again.
I created DLL of wasm3 and Wasm3DotNet for x64 and tried to run your test.wasm in this repo but sees the same crash log. Your environment and my environment might be a bit different and it can be the cause.
Maybe wasm3_dll/wasm3
submodule in your local copy was not updated.
Could you try git pull
and git submodule update
then build DLLs again?
If it does not work, could you try the following ZIP file? This is a copy of entire Unity project I made to test Wasm3DotNet on Unity. It contains DLLs built on my environment. https://1drv.ms/u/s!AvizOnmg-QO6hqhXRqBddisbG_NB5w?e=bccZTa
Cool thanks. I will try !
As I wrote in an issue, I'm trying to use this lib in Unity. https://github.com/tana/Wasm3DotNet/issues/1
By the change by @tana (thanks) , it became that DLL x64 build is successfully created. However, I faced crashes when I run a Unity project.
Condition
Steps
My Code
Log