Results 1 to 2 of 2

Thread: How to build shared library of Qwt ; prevent qmake from linking to QtCore and QtGUI

  1. #1
    Join Date
    Aug 2016
    Posts
    1
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default How to build shared library of Qwt ; prevent qmake from linking to QtCore and QtGUI

    I have final executable myGUIExec; In which I will be linking separately libraries of QtCore and QtGui as libQtCore.a and libQtGui.a

    Now My project requirement is to make shared libraries of Qwt and it should not link to QtCore and QtGui

    I did following steps

    in src.pro in file

    QT -= core -gui

    but I am getting compilation error as

    qwt_abstract_scale_draw.cpp:14:18: fatal error: qmap.h: No such file or directory


    WHat is correct way to make shared library of qwt.so and it should not link or contain code of QtCore and QtGUI

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to build shared library of Qwt ; prevent qmake from linking to QtCore and Qt

    WHat is correct way to make shared library of qwt.so and it should not link or contain code of QtCore and QtGUI
    You are confusing compiling with linking. Removing core and gui from your qmake settings means that qmake no longer knows where to find the header files from these modules, and so your program won't compile. Put them back into the QT setting.

    Qwt requires QtCore and QtGui in order to be used at runtime. The Qwt shared library does not contain any code from these Qt modules, it loads the shared libraries at runtime. When you link the Qwt object files to build a Qwt shared library, you still need to tell it which Qt libraries contain the Qt classes and methods it uses. It doesn't drag any code in with it, but makes a notation that, for example, "QObject" is found in libQtCore.a and so forth.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Build shared library with UTF-8 characters
    By alizadeh91 in forum Qt Programming
    Replies: 1
    Last Post: 27th December 2012, 16:11
  2. Replies: 2
    Last Post: 21st April 2012, 11:36
  3. Linking a custom shared library
    By nomiz in forum Qt Programming
    Replies: 2
    Last Post: 5th March 2012, 07:48
  4. Qmake fails to set shared library dependency
    By jkv in forum Qt Programming
    Replies: 5
    Last Post: 3rd September 2009, 14:44
  5. qmake: dependency of application on common shared library
    By PeterWurmsdobler in forum Qt Programming
    Replies: 5
    Last Post: 27th March 2009, 17:13

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.