Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Static build on Cygwin with Qt3

Static build on Cygwin with Qt3

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 2 Posters 4.7k 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.
  • P Offline
    P Offline
    philippeb8
    wrote on last edited by
    #1

    Hello,

    I am trying to build an independent executable on Cygwin. It comes to my surprise a static version of Qt doesn't come with the installer of Cygwin because it makes a lot of sense to want such a feature.

    Anyways I am trying to build by statically linking the Cygwin libraries using the following features in the pro file:
    QMAKE_CC = i686-pc-mingw32-gcc
    QMAKE_CXX = i686-pc-mingw32-g++
    QMAKE_LINK = i686-pc-mingw32-g++
    QMAKE_LIB = i686-pc-mingw32-ar -ru
    QMAKE_RC = i686-pc-mingw32-windres

    QMAKE_LIBDIR += /usr/lib
    QMAKE_LFLAGS += -static-libgcc

    And I get the following error when I try executing it:
    error while loading shared libraries: libstdc++-6.dll: cannot open shared object file: No such file or directory

    ldd reports:
    ntdll.dll => /cygdrive/c/WINDOWS/system32/ntdll.dll (0x7c900000)
    kernel32.dll => /cygdrive/c/WINDOWS/system32/kernel32.dll (0x7c800000)
    msvcrt.dll => /cygdrive/c/WINDOWS/system32/msvcrt.dll (0x77c10000)
    libstdc++-6.dll => not found
    cygqt-mt-3.dll => /usr/bin/cygqt-mt-3.dll (?)

    This library is located here:
    /usr/lib/gcc/i686-pc-mingw32/4.5.2/debug/libstdc++-6.dll

    But it still doesn't work if I copy it in /usr/bin. Any ideas?

    Thanks,
    -Phil

    1 Reply Last reply
    0
    • L Offline
      L Offline
      loladiro
      wrote on last edited by
      #2

      I have no idea about Qt3, but information for Qt4 are "here":http://doc.trolltech.com/4.7.1/deployment-windows.html#static-linking . Also, you'll still have to deploy some of the cygwin specific files. Oh, and of course you'll have to publish your app under the termes of the GPL, if you decide to use the static version of Qt.

      EDIT: Assuming you don't have a commercial license that is, of course

      1 Reply Last reply
      0
      • P Offline
        P Offline
        philippeb8
        wrote on last edited by
        #3

        Thanks but I was looking not to rebuild the whole Qt. BTW if you build with the following, you won't need all the Cygwin DLL dependencies:
        QMAKE_CXX = i686-pc-mingw32-g++
        QMAKE_LINK = i686-pc-mingw32-g++

        I would hope somebody from Qt would handle the Cygwin package to include a static version of libqt-mt.dll. That would save a lot of problems.

        But my question was about libstdc++-6.dll. Anybody knows how to statically link to libstdc++-6?

        1 Reply Last reply
        0
        • L Offline
          L Offline
          loladiro
          wrote on last edited by
          #4

          Assuming your gcc version if >= 4.5, you can use --static libstdc++ otherwise have a look "here". In any way you'll also have to recompile Qt statically, so you can link it into your app.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            philippeb8
            wrote on last edited by
            #5

            The version of g++ that comes with the latest Cygwin is 4.3.4.

            It's surprising a static version of the library is not provided by either the Cygwin installer or the Qt installer itself. I would definitely recommend adding it somewhere.

            But thanks I'll rebuild Qt from the source package provided by Cygwin.

            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