Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. India
  4. Unable to add library to the .pro file of the target file

Unable to add library to the .pro file of the target file

Scheduled Pinned Locked Moved India
6 Posts 2 Posters 2.7k 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.
  • B Offline
    B Offline
    binnet
    wrote on last edited by
    #1

    I have created a shared library in Qt 5.0.2 called "something". Now, 4 files have been created (something.pro,something.h,something_global.h and something.cpp).
    I want to use this library in another project called "trial". How to use the library "something" in "trial"?

    Please help me as I am new to Qt as well as Linux(Fedora 16).
    I know that I should use
    LIBS += [path to library files]
    INCLUDEPATH+= [path to header files]

    I am unable find the library file (something.so).
    Will "something.so" be auto generated if I have created the library?--

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      something.so will be created when you compile your library as a shared library. If you compile it statically, it will be something.a.

      So you need to compile your library first, and then you can start using it in your trial application.

      (Z(:^

      1 Reply Last reply
      0
      • B Offline
        B Offline
        binnet
        wrote on last edited by
        #3

        Thanks! :)
        I have added the LIBS and INCLUDEPATH.

        Can you please brief me about using a function of the library in the target project file?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Just like with any Qt class/ lib: once you modify LIBS and INCLUDEPATH like you did, all that is left is to #include the header in your code and start using the functionality of that library.

          (Z(:^

          1 Reply Last reply
          0
          • B Offline
            B Offline
            binnet
            wrote on last edited by
            #5

            Thank you for quick reply! will try.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              You are welcome. Usually a few iterations are needed before it starts working (usually people have problems with writing correct LIBS statements, and often there are issues with supplying right paths). But in general, you should be on a good azymouth right now.

              (Z(:^

              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