Replies: 1 comment 1 reply
-
Emscripten cannot use any of those libraries in /mnt/c/Windows/system32 because they are win32/x86 libraries. You most likely need to find the place in the cmake files that is adding those libraries and somehow prevent them from being added. Emscripten can only use emscripten-built libraries, not OS/host specific libraries such as msvct. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have wrestled with this for almost a week now, so I guess it's time to finally admit defeat and ask for help. I hope this is the right place for that, otherwise I apologize!
I'm trying to build QPDF with emscripten. I found a very old build by @jrmuizel that works fine, but I'd like to use some of the newer functionality (you can see it in use here). I have never worked with any C language or emscripten before, so I'm sorry if there's an obvious solution to my issue.
What I've tried is the following:
zlib
andlibjpeg
when runningemcmake cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
. When running said command withoutemcmake
, everything works fine. The documentation for usingexternal-libs
is in the windows readme, so it's probably not ideal to use that on Linux, but that'll at least fix thezlib
andlibjpeg
-issue.BUILD_SHARED_LIBS
and enabledUSE_INSECURE_RANDOM
andSKIP_OS_SECURE_RANDOM
. When running justcmake
, leaving everything as default works just fine.if(WIN32 AND (EXISTS ${qpdf_SOURCE_DIR}/external-libs))
toif(EXISTS ${qpdf_SOURCE_DIR}/external-libs)
in libqpdf/CMakeLists.txt on line 129 to get the second step to actually work.emcmake cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
.cmake --build build
.Now here's the part that I'm stuck on.
wasm-ld
is not able to find external windows libraries:I have tried building with Windows, WSL (Debian 11) and Debian 11 on a VPS. The missing libraries are all in
/mnt/c/Windows/system32
(when using WSL). What I think might work is maybe adding-L/mnt/c/Windows/system32
when running the linker, but I'm not sure if that's possible. The same could potentially also be used to avoid some of the hacky things I have done to get this far such as installingexternal-libs
(which AFAIK is only meant for Windows) and enablingUSE_INSECURE_RANDOM
.This is how the linker is being executed, by the way:
When running
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
and thencmake --build build
, it works just fine. No need forexternal-libs
or changing anything in any of theCMakeLists.txt
-files.This is the whole error message (Windows 11, WSL2, Debian 11):
Again, I hope this is the right place for this. Otherwise, I would greatly appreciate a pointer in the right direction 😸
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions