Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to link 3rd party libraries?



  • I'm getting this at the end of my compile:

    shared:WARNING: emcc: cannot find library "lua5.1"
    shared:WARNING: emcc: cannot find library "hunspell"
    shared:WARNING: emcc: cannot find library "pcre"
    shared:WARNING: emcc: cannot find library "zip"
    shared:WARNING: emcc: cannot find library "z"
    shared:WARNING: emcc: cannot find library "pugixml"
    error: Linking globals named 'regerror': symbol multiply defined!
    shared:WARNING: Note: Input file "@/tmp/tmpfsjXvo.response" did not exist.
    shared:ERROR: Failed to run llvm optimizations: 
    Makefile:1354: recipe for target 'mudlet.js' failed
    make: *** [mudlet.js] Error 1
    

    Emscripten has documentation on it here, but... how does that related to Qt? Qt docs also don't mention 3rd party libraries, so it's not entirely clear on what to do :(



  • They need to be static libraries, as shared libraries are not yet supported in Qt WebAssembly.



  • Thanks! I have no experience building static libraries, any tips on how to get started?

    If I understand correctly, I can just build the library statically with my Qt application - I don't have to build Qt statically as well?



  • @lorn-potter any tips on how to do this? It's rather common for any real application to require more than just Qt.



  • @Vadi2 Did you build the libraries or just downloaded and used them directly ?



  • On Windows we build them, on Ubuntu we install the -dev packages, on macOS we use Homebrew.



  • Any insights in this area would be appreciated! Any application big enough is bound to have dependencies.



  • @Vadi2

    Other than adding your libs with LIBS += -lblahblah
    you shouldn't have to pass anything extra to Qt to get it to link statically, as QtWebAssembly does that anyway.

    You could try QMAKE_LFLAGS += -static in your project if there is any issues, or it tries to link dynamically.


Log in to reply