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. QtCreator - working with third party libraries best practices [multi-platform]
Forum Updated to NodeBB v4.3 + New Features

QtCreator - working with third party libraries best practices [multi-platform]

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 4 Posters 2.1k Views 1 Watching
  • 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.
  • V Offline
    V Offline
    v0idnull
    wrote on last edited by
    #1

    I'm relatively new to C++ so maybe that's the problem. Basically, I am working a small purpose-built media player and I'd like to use http://taglib.github.io/ to get at the metadata of all my media files, and as time goes on I'm pretty certain I'll want to use other libraries as well for various things.

    I am currently developing on windows (my target audience) but I chose Qt specifically so that I can support multiple platforms.

    So initially, I had just unzipped taglib, added the root source folder to my INCLUDEPATH in my pro file. While this allows the IDE to find all the header files, it won't compile as the compiler complains that it cna't find them.

    So what is the best practice here, especially knowing that I will want to compile the same project in several different environments?

    thanks in advance,
    --alex

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andrep
      wrote on last edited by
      #2

      How did the compiler complain exaclty, and what's in your .pro file?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        From what you wrote you are probably not linking to the taglib dll.

        As for best practice, it depends. Essentially use scope in the pro file to distinguishes which platforms does what.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • V Offline
          V Offline
          v0idnull
          wrote on last edited by
          #4

          hello, here is a pastebin of my pro file:

          http://pastebin.com/Xm9tJra6

          The error I get is during compile time, that it can't find the header files that are in the include path.

          However, in the IDE itself, I am able to autocomplete those very same header files.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            First thing to do: either use double backslashes or change them to the unix notation with forward slashes (better solution)

            Then, you're not linking to taglib

            You need to add

            @
            LIBS +=
            -LC:/Users/v0idnull/Documents/Code/c++/libs/taglib-1.9.1/taglib-1.9.1/taglib/folder_where_the_lib_file_can_be_found
            -ltaglib
            @

            to your pro file

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • N Offline
              N Offline
              ningen
              wrote on last edited by
              #6

              like this:
              http://qt-project.org/doc/qt-5/qmake-project-files.html#declaring-other-libraries

              1 Reply Last reply
              0
              • V Offline
                V Offline
                v0idnull
                wrote on last edited by
                #7

                thank you. I suppose this is what I was missing all along. I must compile libs first, and not just try to include them as source.

                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