Compile static lib errors.



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



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.