Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problem's including a static library in Qt



  • Hello i'm trying to include a static library in Qt i do the follow:

    LIBS += -LC:/Users/moh/Desktop/gloox/ -llibgloox.a
    

    But i dont know why return me all time:

    :-1: error: LNK1104 'libgloox.a.lib'
    

    How i could include my static library how i do normally in other ide's . In Qt i couldnt. Thanks in advance!



  • It's the same as everywhere else:

    LIBS += -LC:/Users/moh/Desktop/gloox/ -lgloox
    


  • now i checked and I think the problem is not Qt i think the problem is because for windows compiler static libraries are .lib and for mingw compiler are .a? I'm right or wrong?


  • Lifetime Qt Champion

    Hi,

    You can't mix and match C++ libraries built with MinGW and Visual Studio. Up to VS2015 you can't even use .dll from different versions of VS.


Log in to reply