emscripten-core / emscripten-core/emscripten
c++ virtual functions not working
Open
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
I'm trying to use virtual functions with emscripten like the following :
```
IGameAssembly* asm = Application::GetGameAssembly();
auto scripts = asm ->GetScripts();
for (auto it : scripts)
{
std::cout << it << std::endl;
}
```
the above doesn't work when calling the class interface pointer
it gives an error like ```indirect call to null```
but if I do it like this it works :
```
WebGameAssembly* asm = (WebGameAssembly*)Application::GetGameAssembly();
auto scripts = asm->GetScripts();
for (auto it : scripts)
{
std::cout << it << std::endl;
}
```
any idea on how I can debug this ?
Contributor guide
Assessment
This issue has not been assessed yet.