How to add .a external library to Qt Creator project via graphical interface?

I created the yamlcpp static library (libyaml-cpp.a) using the Qt mingw compiler. Now I want to add it to my project. I use this qt doc , but Qt Creator allows you to select only * .lib files, not * .a files (in the "Select File" dialog box). This is confusing because I am using MinGW 4.4 debug configuration, not MSVC2008.

Can I add * .a libraries via the Qt Creator GUI and how to do it? Windows 7, Qt Creator 2.3.1, Qt 4.7.4

+4
source share
1 answer

As far as I know, this is not possible now. The only way is to edit the .pro file and add lines like this:

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 } 
+5
source

Source: https://habr.com/ru/post/1389270/


All Articles