Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

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

    Tools
    3
    3
    19459
    Loading More Posts
    • 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.
    • G
      geotavros last edited by

      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":http://doc.qt.nokia.com/qtcreator-2.2/creator-project-qmake-libraries.html#to-add-libraries, 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

      1 Reply Last reply Reply Quote 0
      • G
        goetz last edited by

        The easiest and quickest way is to add it to the .pro file in the editor:

        @
        INCLUDEPATH += C:/path/to/includedir
        LIBS += -LC:/path/to/libdir -lyaml-cpp
        @

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply Reply Quote 0
        • T
          tobias.hunger last edited by

          The documentation you reference are about adding a static library to your project: Not only to use it, but to have it built from sources as part of your project. I am not sure that is what you want.

          I usually just add it to the LIBS in the relevant .pro file, just like Volker suggested.

          You should also be able to right-click your project and select "Add library" from the context menu there.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post