Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to add an external .a library in Qt Creator project via GUI?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 3 Posters 20.0k Views
  • 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 Offline
    G Offline
    geotavros
    wrote on last edited by
    #1

    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
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      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
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on last edited by
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved