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 make Qwt shared library without libQtGui abd libQtCore
Forum Updated to NodeBB v4.3 + New Features

How to make Qwt shared library without libQtGui abd libQtCore

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 1.1k Views 4 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by A Former User
    #1

    I have project in which I have to make

    1. Use Static library of libQtGui.a and libQtCore.a
    2. I have source code of qwt and while making shared libraries of qwt , I want to prevent qmake from linking to QtCore and QtGui . Basically I want qwt should build without QtGui and QtCore

    At the end I will be linking all together in my final executable

    1. Static libraries of libQtGui.a
    2. Static library of libQtCore.a
    3. Dynamic library of qwt. So as mentioned in color text

    I tried to give

    CONFIG -= gui core
    LIBS -= -lQtGui –lQtCore

    But I am not able to achive the results . It will be helpful if you could provide your inputs on the same

    kshegunovK 1 Reply Last reply
    0
    • R Offline
      R Offline
      Rondog
      wrote on last edited by Rondog
      #2

      I believe you asked this question before.

      Dynamic linking is the answer to this problem. You have multiple executable's that require QtGui and QtCore so having one set of these as dynamic libraries that are loaded as needed makes sense.

      If you want to statically link these to your executable's you will have duplicate copies in all executable's that require them. You will, of course, increase the size of your application by including the extra duplicated copies.

      If you want to have qwt statically link QtGui and QtCore and then, somehow, use that specific copy in other executable's I think you are out of luck. Imported functions does not automatically become exported functions that can be used elsewhere.

      If you have the source code to all of this you might be able to turn it into one single executable statically linking to everything you need (?). You would really need to be serious about having a single executable if you want to go in this route.

      I, personally, wouldn't do this. Don't static link to QtGui, QtCore, or 'qwt' (whatever that is) and everything should work out well. So what if you end up with a few extra library files.

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

        @Rondog Looks like this one indeed

        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
        1
        • Q Qt Enthusiast

          I have project in which I have to make

          1. Use Static library of libQtGui.a and libQtCore.a
          2. I have source code of qwt and while making shared libraries of qwt , I want to prevent qmake from linking to QtCore and QtGui . Basically I want qwt should build without QtGui and QtCore

          At the end I will be linking all together in my final executable

          1. Static libraries of libQtGui.a
          2. Static library of libQtCore.a
          3. Dynamic library of qwt. So as mentioned in color text

          I tried to give

          CONFIG -= gui core
          LIBS -= -lQtGui –lQtCore

          But I am not able to achive the results . It will be helpful if you could provide your inputs on the same

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          @Qt-Enthusiast said in how to make qwt shared library without libQtGui abd libQtCore:

          I have source code of qwt and while making shared libraries of qwt , I want to prevent qmake from linking to QtCore and QtGui . Basically I want qwt should build without QtGui and QtCore

          Not possible even by a long shot.

          Read and abide by the 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