Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. How to link 3rd party libraries?
QtWS25 Last Chance

How to link 3rd party libraries?

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
8 Posts 3 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vadi2
    wrote on 3 Oct 2019, 16:02 last edited by
    #1

    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 :(

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lorn.potter
      wrote on 4 Oct 2019, 00:40 last edited by
      #2

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

      Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
      Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

      1 Reply Last reply
      2
      • V Offline
        V Offline
        Vadi2
        wrote on 4 Oct 2019, 05:32 last edited by
        #3

        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?

        1 Reply Last reply
        0
        • V Offline
          V Offline
          Vadi2
          wrote on 11 Oct 2019, 07:35 last edited by
          #4

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

          P 1 Reply Last reply 11 Oct 2019, 08:09
          0
          • V Vadi2
            11 Oct 2019, 07:35

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

            P Offline
            P Offline
            Pradeep P N
            wrote on 11 Oct 2019, 08:09 last edited by
            #5

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

            Pradeep Nimbalkar.
            Upvote the answer(s) that helped you to solve the issue...
            Keep code clean.

            1 Reply Last reply
            1
            • V Offline
              V Offline
              Vadi2
              wrote on 11 Oct 2019, 08:25 last edited by
              #6

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

              1 Reply Last reply
              0
              • V Offline
                V Offline
                Vadi2
                wrote on 26 Oct 2019, 15:57 last edited by
                #7

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

                L 1 Reply Last reply 31 Oct 2019, 19:49
                0
                • V Vadi2
                  26 Oct 2019, 15:57

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

                  L Offline
                  L Offline
                  lorn.potter
                  wrote on 31 Oct 2019, 19:49 last edited by
                  #8

                  @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.

                  Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
                  Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved