emscripten-core / emscripten-core/emscripten

To use dlopen, you need to use Emscripten's linking support

Open
#4,387 21 comments 0 reactions 0 assignees View on GitHub
good first bug help wanted wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I try to link dynamic lib to my code, but I get message as in issue name. I use dlopen for link library and set compilers flags from main - MAIN_MODULE=1 and SIDE_MODULE=1 for .so.
My Makefile for dynamic lib:

```
libWebLib.js: WebLib.cpp
emcc -fPIC -c WebLib.cpp -o WebLib.o
emcc -shared -Wl,libWebLib.js -o libWebLib.js WebLib.o -s SIDE_MODULE=1
clean: $rm *.o *.so
```

And loadlib:

```
void *handle;
handle = dlopen("libWebLib.so", RTLD_NOW);
```

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.