Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to add a external library on Windows

How to add a external library on Windows

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 3.2k 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.
  • S Offline
    S Offline
    Steban
    wrote on last edited by
    #1

    I try to add a external library modifying the .pro file with the following code:

    @
    win*{
    LIBS += -L/C:/CornerStone/include -lMultiWidgets -lFluffy
    CONFIG += console
    }
    @

    but without success.

    [EDIT: code formatting, Volker]

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on last edited by
      #2

      -L/C:/CornerStone/include is not a valid search path for additional libraries directories. You should write -LC:/CornerStone/include (without first slash). Are MultiWidgets.lib and Fluffy.lib in that directory ?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Steban
        wrote on last edited by
        #3

        MultiWidgets and Fluffy are folders with a lot of .hpp files.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          If you want to add an include directory you will have to use INCLUDEPATH.
          If you want to add binary libraries or import libraries you will have to use LIBS.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            INCLUDEPATH is for the includes, LIBS get the libraries.

            @
            INCLUDEPATH += C:/CornerStone/include

            LIBS += -LC:/CornerStone/lib
            LIBS += -lMultiWidgets -lFluffy
            @

            It's unlikely that the include directory contains the libs.

            The directory C:/CornerStone/lib must contain MultiWidgets.lib and Fluff.lib. If not, search for the directories that contain those and add them to the LIBS variable.

            And as cincirin already mentioned, leave out the leading slash of the paths.

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

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Steban
              wrote on last edited by
              #6

              I found de lib folder with Multiwidgets.lib. But the thing is that the files that i need are hpp type, not libs type. And this are in the include folder.
              So, how can i add the include folder, that contains the .hpp files that i need?

              1 Reply Last reply
              0
              • L Offline
                L Offline
                lgeyer
                wrote on last edited by
                #7

                [quote author="Steban" date="1325609743"]So, how can i add the include folder, that contains the .hpp files that i need?[/quote]

                [quote author="Lukas Geyer" date="1325283449"]If you want to add an include directory you will have to use INCLUDEPATH.[/quote]

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  You will most probably need the .hpp files and the .lib files. Without the first, your compilation fails, without the latter the linking fails.

                  Some hints and a complete example have been given, you're supposed to adapt them to your needs.

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

                  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