emscripten-core/emscripten

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

Open

#4,387 创建于 2016年6月7日

在 GitHub 查看
 (21 评论) (0 反应) (0 负责人)C++ (3,519 fork)batch import
good first bughelp wantedwontfix

仓库指标

Star
 (27,361 star)
PR 合并指标
 (平均合并 19天 10小时) (30 天内合并 147 个 PR)

描述

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);

贡献者指南