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. Non Qt application linking Qt library
Forum Updated to NodeBB v4.3 + New Features

Non Qt application linking Qt library

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.5k Views 2 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.
  • K Offline
    K Offline
    kumararajas
    wrote on last edited by
    #1

    Hello,

    I have a Qt based library. And I want to link with non Qt application.

    When I link it, the linkers get mad about Qt libraries. It expects me to link Qt libraries as well.

    Is this an expected behaviour?

    Can I not just link only the library I want?

    Thanks,
    Kumara

    --Kumar

    1 Reply Last reply
    0
    • Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      Could it be possible you share your Qt library project file? I guess your library will depend at least on Qt Core

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      K 1 Reply Last reply
      0
      • Pablo J. RoginaP Pablo J. Rogina

        Could it be possible you share your Qt library project file? I guess your library will depend at least on Qt Core

        K Offline
        K Offline
        kumararajas
        wrote on last edited by
        #3

        @Pablo-J.-Rogina

        Hi,

        Here is the pro file content.

        QT       += core gui
        
        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
        
        TARGET          = uicore
        TEMPLATE        = lib
        CONFIG         += staticlib
        
        # Find the built application here..
        DESTDIR         = ../lib
        

        Yes, as you mentioned, my library depends on Qt Core and Qt Gui.

        I understand that my library needs these Qt libraries.

        But, I am trying to avoid linking Qt libraries for the non Qt application.

        --Kumar

        1 Reply Last reply
        0
        • Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          I understand that for 'staticlib' to work, you first have to build Qt statically. You may want to take a look at this post.
          And please also consider that using Qt statically is very likely that require a commercial license for Qt. There's much debate about LGPL and static linking, you may need some legal advice in that case. I guess this post is a good starting point to understand the possible cases

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          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