Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] MinGW can't find libraries when compiling static build.

[Solved] MinGW can't find libraries when compiling static build.

Scheduled Pinned Locked Moved General and Desktop
mingwstaticlibrarieslibslibrarycompile-errorsbuild
7 Posts 2 Posters 7.8k 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.
  • L Offline
    L Offline
    LittleCat
    wrote on 26 Mar 2015, 09:45 last edited by LittleCat
    #1

    Hello everyone. I am having a problem when trying to compile a static build for QT using MinGW.

    I think it's attempting to find the libraries that are made during the compile process, but can't find them for some reason, but I'm not sure. Can anyone help me with that?

    This is a log of the failed build:

    g++ -static -static-libgcc -Wl,--gc-sections -Wl,-s -Wl,-subsystem,console -o C:
    \qt-src\qtbase\bin\qml.exe .obj/release/main.o .obj/release/qml_qml_plugin_impor
    t.o .obj/release/qml_plugin_import.o .obj/release/qrc_qml.o .obj/release/moc_con
    f.o -LC:\openssl-1.0.2a\dist\lib -LC:/qt-src/qtbase/lib -lQt5Widgets -LC:/qt-sr
    c/qtbase/qml/QtQuick/Window.2 -lwindowplugin -LC:/qt-src/qtbase/qml/QtQuick.2 -l
    qtquick2plugin -LC:/qt-src/qtbase/plugins/qmltooling -lqmldbg_qtquick2 -lQt5Quic
    k -lqmldbg_tcp -lQt5Qml -LC:/qt-src/qtbase/plugins/bearer -lqgenericbearer -lqna
    tivewifibearer -lQt5Network -ldnsapi -lssl -lcrypto -lcrypt32 -LC:/qt-src/qtbase
    /plugins/platforms -lqwindows -lwinspool -lshlwapi -lQt5PlatformSupport -LC:/qt-
    src/qtbase/plugins/imageformats -lqdds -lqicns -lqico -lqjp2 -lqmng -lqtga -lqti
    ff -lqwbmp -lqwebp -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm -lglu32 -lopen
    gl32 -lgdi32 -lqtharfbuzzng -lQt5Core -lole32 -luuid -lws2_32 -ladvapi32 -lshell
    32 -luser32 -lkernel32 -lmpr -lz
    C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
    n/ld.exe: cannot find -lqdds
    C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
    n/ld.exe: cannot find -lqicns
    C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
    n/ld.exe: cannot find -lqjp2
    C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
    n/ld.exe: cannot find -lqmng
    C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
    n/ld.exe: cannot find -lqtga
    C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
    n/ld.exe: cannot find -lqtiff
    C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
    n/ld.exe: cannot find -lqwbmp
    C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
    n/ld.exe: cannot find -lqwebp
    collect2.exe: error: ld returned 1 exit status
    Makefile.Release:86: recipe for target 'C:\qt-src\qtbase\bin\qml.exe' failed
    mingw32-make[4]: *** [C:\qt-src\qtbase\bin\qml.exe] Error 1
    mingw32-make[4]: Leaving directory 'c:/qt-src/qtdeclarative/tools/qml'
    Makefile:34: recipe for target 'release' failed
    mingw32-make[3]: *** [release] Error 2
    mingw32-make[3]: Leaving directory 'c:/qt-src/qtdeclarative/tools/qml'
    Makefile:95: recipe for target 'sub-qml-make_first' failed
    mingw32-make[2]: *** [sub-qml-make_first] Error 2
    mingw32-make[2]: Leaving directory 'c:/qt-src/qtdeclarative/tools'
    Makefile:66: recipe for target 'sub-tools-make_first' failed
    mingw32-make[1]: *** [sub-tools-make_first] Error 2
    mingw32-make[1]: Leaving directory 'c:/qt-src/qtdeclarative'
    makefile:217: recipe for target 'module-qtdeclarative-make_first' failed
    mingw32-make: *** [module-qtdeclarative-make_first] Error 2

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 26 Mar 2015, 09:56 last edited by
      #2

      You may need to add -qt-libwebp and friends to configure, but a normal static build should already do that.

      (Z(:^

      L 1 Reply Last reply 26 Mar 2015, 10:11
      0
      • S sierdzio
        26 Mar 2015, 09:56

        You may need to add -qt-libwebp and friends to configure, but a normal static build should already do that.

        L Offline
        L Offline
        LittleCat
        wrote on 26 Mar 2015, 10:11 last edited by
        #3

        @sierdzio -qt-libwebp doesn't even exists.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 26 Mar 2015, 10:19 last edited by
          #4

          Mhm, I suspected that. Definitely, the problem is with media codecs (MNG, WebP and so on). I have not encountered this. Can you tell us which Qt version are you trying to compile, what were your configure flags, and how you acquired Qt source code (because the code you get from Qt Maintenance Tool will not compile).

          (Z(:^

          L 1 Reply Last reply 26 Mar 2015, 10:42
          0
          • S sierdzio
            26 Mar 2015, 10:19

            Mhm, I suspected that. Definitely, the problem is with media codecs (MNG, WebP and so on). I have not encountered this. Can you tell us which Qt version are you trying to compile, what were your configure flags, and how you acquired Qt source code (because the code you get from Qt Maintenance Tool will not compile).

            L Offline
            L Offline
            LittleCat
            wrote on 26 Mar 2015, 10:42 last edited by LittleCat
            #5

            @sierdzio I'm trying to compile version 5.4.1, and I got the source from here http://www.qt.io/download-open-source/#section-2 (It's in other downloads)

            And here are my flags for configure:

            configure -static -release -opensource -opengl desktop -openssl-linked OPENSSL_LIBS="-lssl -lcrypto -lgdi32" -nomake examples

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 26 Mar 2015, 10:48 last edited by
              #6

              Looks fine. I do not know why are you getting this bug

              (Z(:^

              1 Reply Last reply
              0
              • L Offline
                L Offline
                LittleCat
                wrote on 27 Mar 2015, 21:41 last edited by
                #7

                Well, I tried compiling the source from scratch with a fresh source, and it works like a charm for some reason. Problem Solved.

                1 Reply Last reply
                0

                7/7

                27 Mar 2015, 21:41

                • Login

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