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!
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'
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.
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.
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):
Code:
QWT_LIB = qwt_designer_plugin
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.
Re: QTCreator does not see qwt library
Okay, thanks. I'll correct and hopefully have no issues.
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?
Re: QTCreator does not see qwt library
Quote:
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.
Quote:
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.
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?
Re: QTCreator does not see qwt library
Quote:
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?
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.
Re: QTCreator does not see qwt library
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.
Re: QTCreator does not see qwt library
Okay, I'll try that and close this thread.