Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emcc: cannot find library "dl" #5318

Closed
wolf188 opened this issue Jun 18, 2017 · 7 comments
Closed

emcc: cannot find library "dl" #5318

wolf188 opened this issue Jun 18, 2017 · 7 comments
Labels

Comments

@wolf188
Copy link

wolf188 commented Jun 18, 2017

appear some error message when compile. for example,
emmake make
Scanning dependencies of target hello.html
[ 50%] Building CXX object CMakeFiles/hello.html.dir/src/main.cpp.o
[100%] Linking CXX executable hello.html
WARNING:root:emcc: cannot find library "dl"
warning: unresolved symbol: glfwWindowHint
[100%] Built target hello.html

@wolf188
Copy link
Author

wolf188 commented Jun 18, 2017

I can find the file of libdl.a at this directory. "/usr/lib/x86_64-redhat-linux6E/lib64"

@cpitclaudel
Copy link

You need an emscripten-compiled copy of that library (dl). Compile it separately, from source (with emscripten), and then add the appropriate flags to ./configure (presumably something like env CPPFLAGS="-I${YOUR_COMPILED_LIB's_ROOT}" LDFLAGS="-L${YOUR_COMPILED_LIB's_ROOT}/.libs" emconfigure ./configure.

@juj
Copy link
Collaborator

juj commented Jun 19, 2017

It is safe to ignore that link warning, since Emscripten implements dlopen() already in the core shipped libraries.

However there are some caveats. @kripken knows the details here the best. @kripken : would it make sense to add -ldl to the set of ignored core libraries? (at https://github.com/kripken/emscripten/blob/master/tools/shared.py#L1984 ?) Or does our support fundamentally differ in some ways from what libdl can offer?

@kripken
Copy link
Member

kripken commented Jun 19, 2017

Probably it makes sense to add to that list, we do have core dlopen functionality working. It has some limitations, but I don't think enough to justify not including it.

@wolf188
Copy link
Author

wolf188 commented Jun 21, 2017

https://github.com/wolf188/emscripten_project.git
The test project can not run . why ?? Who can help me ?
emmake make
Scanning dependencies of target hello.html
[ 50%] Building CXX object CMakeFiles/hello.html.dir/src/main.cpp.o
[100%] Linking CXX executable hello.html
warning: unresolved symbol: glfwWindowHint

juj added a commit that referenced this issue Jun 21, 2017
@juj
Copy link
Collaborator

juj commented Jun 21, 2017

glfwWindowHint does seem to be present, but looks like it is part of GLFW 3 and requires -s USE_GLFW=3 linker flag set to enable GLFW 3 instead of the default GLFW 2. Perhaps that is the reason?

buu700 pushed a commit to buu700/emscripten that referenced this issue Jul 20, 2017
@stale
Copy link

stale bot commented Aug 30, 2019

This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Aug 30, 2019
@stale stale bot closed this as completed Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants