Results 1 to 14 of 14

Thread: QTCreator does not see qwt library

  1. #1
    Join Date
    Dec 2019
    Posts
    29
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QTCreator does not see qwt library

    Hi,

    It seems I'm having an issue with running qwt under Qt Creator on a MAC. It works fine on Windows and CentOS.

    I installed and built qwt on my MAC as per the instructions on the qwt website.

    The library is installed in /usr/local/qwt-6.1.5/plugins/designer an the library name is libqwt_designer_plugin.dylib

    in the project file I reference this library as I do with any other but for some reason I keep getting the error: library not found -llibrary_designer_plugin, linker command failed with exit code 1 (use -v to see invocation). Here are parts of the project file which references the qwt library.

    ---------------
    QT += core gui
    CONFIG += qwt

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = MyAppName
    TEMPLATE = app

    Sources += \
    whole bunch of sources

    HEADERS += \
    whole bunch of .h files

    FORMS += \
    mainwindow.ui

    QWT_LIB_PATH = /usr/local/qwt-6.1.5/plugins/designer
    QWT_SRC_PATH = /Users/Myname/Qt/qwt-6.1.5
    PLATFORM = macos1014-clang100
    QWT_LIB = libqwt_designer_plugin


    INCLUDEPATH += Bunch of sources \
    $${QWT_SRC_PATH}/src

    LIBS += -L$$(bunch of other libs path} \
    -lsomeLibs \
    -L$${QWT_LIB_PATH} \
    -l$${QWT_LIB}


    ---------------------------
    Not sure what I can be doing wrong, this should be straight forward. Any help would be appreciated.
    I'm running on Catalina 10.15.7

    Thanks in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    502
    Thanked 75 Times in 71 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTCreator does not see qwt library

    You have to remote the lib prefix from the library name - it has to be '-lqwt_designer_plugin'

  3. #3
    Join Date
    Dec 2019
    Posts
    29
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTCreator does not see qwt library

    Yes I did that see:
    -l$${QWT_LIB}

    I also tried hard coded as you mentioned no variable '-lqwt_designer_plugin' still the same issue.

  4. #4
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    502
    Thanked 75 Times in 71 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTCreator does not see qwt library

    Apart from this - a plugin doesn't need to be linked at all. It's dynamically loaded at runtime by the designer so the qwt widgets are shown up there, nothing more.

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,718
    Thanks
    259
    Thanked 759 Times in 749 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: QTCreator does not see qwt library

    Aside from the errors in specifying the name of the library (and your .pro file should read like this):

    Qt Code:
    1. QWT_LIB = qwt_designer_plugin
    To copy to clipboard, switch view to plain text mode 

    why are you linking to the Qt Designer plugin when you are creating a standalone app? The plugin is for use by Qt Designer to make Qwt widgets visible in the Designer so you can add them to a GUI.

    When you are building an app, you link to the Qwt library itself, not the designer library.

    Qt Code:
    1. QWT_LIB = qwt
    To copy to clipboard, switch view to plain text mode 
    <=== 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.

  6. #6
    Join Date
    Dec 2019
    Posts
    29
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTCreator does not see qwt library

    Okay, thanks. I'll correct and hopefully have no issues.

  7. #7
    Join Date
    Dec 2019
    Posts
    29
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTCreator does not see qwt library

    Since I can let qtCreator link qwt directly I kept the first line CONFIG += qwt and removed all instances of qwt lib, but now I get:
    undefined symbols for architecture x86_64
    linker command failed.

    I didn't have this before using qwt so it must be related. Any ideas?

    Thanks.


    Added after 5 minutes:


    Indeed it is related to qwt clicking on the above error shows all references to qwt.

    On another note, I can't find the qwt library on MAC. Can easily be found on windows and CentOS. Where would I find it?
    Last edited by leinad; 6th October 2020 at 18:37.

  8. #8
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,718
    Thanks
    259
    Thanked 759 Times in 749 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: QTCreator does not see qwt library

    undefined symbols for architecture x86_64
    Indeed it is related to qwt clicking on the above error shows all references to qwt.
    If this is Windows, libraries built for 32- and 64-bit architectures are not compatible. It looks like you are trying to link a 32-bit library with a 64-bit app.

    On another note, I can't find the qwt library on MAC. Can easily be found on windows and CentOS. Where would I find it?
    You probably have to build it from sources. It is not part of a Qt distribution and I don't know if Uwe supplies a pre-built binary for the MacOS platform.
    <=== 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.

  9. #9
    Join Date
    Dec 2019
    Posts
    29
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTCreator does not see qwt library

    This is for MAC. I already built from source by following the user guide instructions, that is how I got the qwt_designer_plugin library. I would have expected it would build the qwt lib as well but it did not. It does for Windows and CentOS. I'm not a MAC expert which is why I'm asking. Is there something more I need to do besides qmake qwt.pro, make, and make install?

  10. #10
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,718
    Thanks
    259
    Thanked 759 Times in 749 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: QTCreator does not see qwt library

    Is there something more I need to do besides qmake qwt.pro, make, and make install?
    Surprising that it doesn't also build qwt itself. I would think that the plugin requires it, but maybe not. My guess is your steps are probably all that is required. Is there any info on the Qwt project page or in the docs?
    <=== 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.

  11. #11
    Join Date
    Dec 2019
    Posts
    29
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTCreator does not see qwt library

    That's all I can find. This is weird. It works fine on CentOS and Windows so I am at a loss. There is very little information regarding this problem. If there was something special I need to do, I wish the documentation would specify it.

  12. #12
    Join Date
    Dec 2019
    Posts
    29
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTCreator does not see qwt library

    Any ideas please?

  13. #13
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,718
    Thanks
    259
    Thanked 759 Times in 749 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: QTCreator does not see qwt library

    There is a Qwt-specific section of this forum (under Qt Programming). Ask your question there and Uwe will almost certainly respond.
    <=== 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.

  14. #14
    Join Date
    Dec 2019
    Posts
    29
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTCreator does not see qwt library

    Okay, I'll try that and close this thread.

Similar Threads

  1. QtCreator with boost library is very slow
    By Scope in forum Qt Programming
    Replies: 1
    Last Post: 31st December 2015, 21:03
  2. Replies: 6
    Last Post: 3rd December 2013, 05:05
  3. Linking a foreign static library using QtCreator
    By gib in forum Qt Programming
    Replies: 0
    Last Post: 22nd September 2010, 03:52
  4. QtCreator 2.0 crashes application working in QtCreator 1.3
    By been_1990 in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2010, 13:58
  5. Creating Library using QTCreator (hiddevice)
    By AlphaWolfXV in forum Qt Programming
    Replies: 0
    Last Post: 2nd February 2010, 14:02

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.