Qt Forum

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

    Qt Academy Launch in California!

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

    India
    2
    6
    2337
    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.
    • B
      binnet last edited by

      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 Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        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 Reply Quote 0
        • B
          binnet last edited by

          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 Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            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 Reply Quote 0
            • B
              binnet last edited by

              Thank you for quick reply! will try.

              1 Reply Last reply Reply Quote 0
              • sierdzio
                sierdzio Moderators last edited by

                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 Reply Quote 0
                • First post
                  Last post