Qt – How to add an external .a library in Qt Creator project via GUI

qtqt-creator

I've built yamlcpp static (libyaml-cpp.a) library using Qt's mingw compiler.
Now I want to add it to my project. I use this qt doc, but Qt Creator allows to select only *.lib files not *.a files (in Choose file dialog). That's confusing because I'm using MinGW 4.4 debug configuration, not MSVC2008.

Is it possible to add *.a libraries via Qt Creator's GUI and how do I do it?
Windows 7, Qt Creator 2.3.1, Qt 4.7.4

Best Answer

As far as I know it is impossible now. The only way is to edit .pro file and add such lines:

win32 {
    #/* If you compile with QtCreator/gcc: */
    win32-g++:LIBS += -L"$$_PRO_FILE_PWD_/libs/"
    win32-g++:LIBS += -lyaml-cpp

    #/* IF you compile with MSVC:
    #win32-msvc:LIBS += /path/to/your/libMyLib.lib*/
}


macx {
    LIBS += -L"$$_PRO_FILE_PWD_/libs/"
    LIBS += -lyaml-cpp-mac
}
Related Topic