emscripten-core/emscripten

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

Open

#4.387 geöffnet am 7. Juni 2016

Auf GitHub ansehen
 (21 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (3.519 Forks)batch import
good first bughelp wantedwontfix

Repository-Metriken

Stars
 (27.361 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 19T 10h) (147 gemergte PRs in 30 T)

Beschreibung

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