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. Compile static lib errors.
Qt 6.11 is out! See what's new in the release blog

Compile static lib errors.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.7k Views 1 Watching
  • 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.
  • C Offline
    C Offline
    CM972
    wrote on last edited by
    #1

    Hello,
    I am tring to deploy a static library created with qt under windows.

    Here is the .pro file
    @TEMPLATE = lib
    DEPENDPATH += .
    INCLUDEPATH += .

    TARGET = MyLib
    CONFIG =qt staticlib opengl release

    QMAKE_LFLAGS = -static

    SOURCES += My Sources

    HEADERS += My headers

    QT =core gui opengl@

    This generates a .a file that is only 39ko.
    When I build the same source code on mac it weights about 1Mo and it works fine.
    When I link the generated .a to another project I get a lot of undefined reference error.
    How can I compile my project statically on windows to make it work ?

    Thank you.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      picasoft
      wrote on last edited by
      #2

      That's my build.bat file which I use to build Qt staticaly

      @
      SET PATH=C:\Qt\4.6.1\bin;C:\Qt\4.6.1\include;%PATH%
      call vsvars32.bat
      nmake confclean

      configure.exe -static -no-qt3support -qt-libpng -qt-libjpeg -qt-gif -qt-zlib -no-phonon-backend -platform win32-msvc2005 -debug-and-release
      
      nmake
      

      @
      Now I use them in MS Visual Studio 2005 and it works fine.
      Just specify Multi-threaded (/MT) option in properties dialog.

      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