emscripten-core / emscripten-core/emscripten

module can't find dyncall_viff

Open
#14,802 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I'm trying to call a function loaded from a side module, the function takes 1 argument which is a reference to an object.

this is how I call the function in c++ code
```
typedef void (*INITLIBFN)(ApplicationComponents& appComponents);

INITLIBFN initfunc = (INITLIBFN)dlsym((void*)1, "InitGameAssembly");

initfunc(appcomps);
```

at first I got this error :
```
sandbox.js:1819 Uncaught (in promise) TypeError: Cannot read property 'apply' of undefined
at dynCallLegacy (sandbox.js:1819)
at dynCall (sandbox.js:1823)
at sandbox.js:1830
at stubs. (sandbox.js:2019)
at :wasm-function[622]:0x628b2
at :wasm-function[620]:0x62056
at :wasm-function[623]:0x62a87
at SandboxLayer::OnAttach() (sandbox.wasm:0x43d239)
at Akkad::Application::RunImpl() (sandbox.wasm:0x4464f0)
at __original_main (sandbox.wasm:0x43c2e1)
```
after many hours of looking into the module javascript file I found the following in ```dynCallLegacy ```
![dyncall](https://user-images.githubusercontent.com/18310807/128086576-f58dd824-d048-4e94-af79-5950ba66531d.PNG)

it's getting called with signature ```viff``` with dynCall prefix to it.

I looked all around the module for ```dynCall_viff``` which it doesn't exist, the only thing close to it is ```dynCall_vifff``` (with 3 f)

now I don't know what dynCall exactly does and why it is trying to call a function which the module doesn't have.
any idea on how I can fix this mess ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.