Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Including a project as library
Qt 6.11 is out! See what's new in the release blog

Including a project as library

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 926 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.
  • D Offline
    D Offline
    dualfaces
    wrote on last edited by
    #1

    Hello,

    Assume I have two Qt projects, one, lets call it 'LibA' specified in the .pro file as
    TEMPLATE = lib and another gui application 'Test'. I develop on Windows 7.
    LibA is placed under C:\LibA and Test is placed under C:\Test. Furthermore i specified a common build directory C:\builds.
    In order to call functions of LibA in Test i add C:\LibA to the includepath of Test and added LIBS += C:\builds\LibA.a .
    Compiling using MinGw works fine, the application is executed and the functions of LibA are executed. Then i change the target to Android. Again compilation works fine, but when starting the application it says
    @ld returned 1 exit status, collect2.exe not found@

    What is the proper way to integrate a library in a project such that it can be used for multiple targets?

    Thank you!

    Regards

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dualfaces
      wrote on last edited by
      #2

      nobody has an idea how to do that?

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

        Hi,

        You have to rebuild both for your various targets or use a subdir project where you build both one after the other so you won't have to handle the different target for every single project.

        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

        • Login

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