Ubuntu 13.04 and qwt/qtcreator troubles
Running under a new install of Ubuntu 13.04, I have installed Qt and qwt and have 'most' of it running. My current goals are
(1) get qwt plugin to work in qtcreator and
(2) get the qwt header files to link properly from qtcreator.
My Qt is Qt Creator 2.7.0 Based on Qt 5.0.2 (64 bit) and is installed at its default location: /opt/Qt5.0.2.
qwt is installed at its default location: /usr/local/qwt-6.1.0/
A fair fraction of all of this works. For example, if I run qtcreator as super-user I can compile and run qwt demos such as curvedemo1. I do get one little warning:
val@zar:/opt/Qt5.0.2/Tools/QtCreator/bin$ sudo ./qtcreator
(qtcreator:4309): IBUS-WARNING **: The owner of /home/val/.config/ibus/bus is not root!
To get the qtcreator to find the qwt plugin, I can copy a qwt plugin.so to one of qt's several designer folders:
qwt creates two plugin files:
/usr/local/qwt-6.1.0/plugins/designer/libqwt_designer_plugin.so 150.7 kB
/usr/local/qwt-6.1.0/designer/plugins/designer/libqwt_designer_plugin.so 195.1 kB
qt has three designer folders:
/opt/Qt5.0.2/5.0.2/gcc_64/examples/designer/
/opt/Qt5.0.2/5.0.2/gcc_64/plugins/designer/
/opt/Qt5.0.2/Tools/QtCreator/bin/designer/
Try .so files in qt's /plugins/designer:
sudo cp /usr/local/qwt-6.1.0/designer/plugins/designer/libqwt_designer_plugin.so /opt/Qt5.0.2/5.0.2/gcc_64/plugins/designer/
NOPE
sudo cp /usr/local/qwt-6.1.0/plugins/designer/libqwt_designer_plugin.so /opt/Qt5.0.2/5.0.2/gcc_64/plugins/designer/
NOPE
Try .so files in qt's /examples/designer:
sudo cp /usr/local/qwt-6.1.0/designer/plugins/designer/libqwt_designer_plugin.so /opt/Qt5.0.2/5.0.2/gcc_64/examples/designer/
NOPE
sudo cp /usr/local/qwt-6.1.0/plugins/designer/libqwt_designer_plugin.so /opt/Qt5.0.2/5.0.2/gcc_64/examples/designer/
NOPE
sudo cp /usr/local/qwt-6.1.0/plugins/designer/libqwt_designer_plugin.so /opt/Qt5.0.2/Tools/QtCreator/bin/designer/ YES
sudo cp /usr/local/qwt-6.1.0/designer/plugins/designer/libqwt_designer_plugin.so /opt/Qt5.0.2/Tools/QtCreator/bin/designer/ YES
Either of the designer plugin .so files seem to provide the qwt widgets to qtcreator but only if they are put in the designer folder under Tools etc. I wonder what the difference is between the two qwt libraryfiles???
Anyway, that is one way, a brute force way, to get qtcreator to see qwt widgets via a plugin library.
Now we come to (2), linking to the qwt .h files when compiling from my user space (not as root).
I have a trivial qwt project (one widget on form) and compile yields:
/home/val/QT/qwtTest/build-qwtTest-Desktop_Qt_5_0_2_GCC_64bit-Debug/ui_qwttest.h:22: error: qwt_dial.h: No such file or directory
So, I need to link to where qwt has the include files.
I crossed my fingers and put CONFIG += qwt in my .pro file but this did not resolve the link error.
Again, it seems qwt has several possible places where .h files are stored. My missing file can be found at:
/usr/local/qwt-6.1.0/src
/usr/local/qwt-6.1.0/include/
I will first try adding the following to my .pro file:
INCLUDEPATH += "/usr/local/qwt-6.1.0/include"
This got me past the .h file problem and now I have undefined reference errors:
home/val/QT/qwtTest/build-qwtTest-Desktop_Qt_5_0_2_GCC_64bit-Debug/ui_qwttest.h:42: error: undefined reference to `QwtDial::QwtDial(QWidget*)'
Trying the /src location gives the same errors.
At this point I seem to be stuck.
And, getting to the point where qwt objects can be used in qtcreator should not be such an agony!
I welcome any suggestions.
Re: Ubuntu 13.04 and qwt/qtcreator troubles
Quote:
Originally Posted by
val
My Qt is Qt Creator 2.7.0 Based on Qt 5.0.2 (64 bit) and is installed at its default location: /opt/Qt5.0.2.
qwt is installed at its default location: /usr/local/qwt-6.1.0/
Try "ldd /usr/local/qwt-6.1.0/lib/libqwt.so" to see if Qwt has also been build for Qt 5.0.
Quote:
Originally Posted by
val
For example, if I run qtcreator as super-user I can compile and run qwt demos such as curvedemo1.
There is absolutely no reason for being root here. Don't do it !
Quote:
Originally Posted by
val
val@zar:/opt/Qt5.0.2/Tools/QtCreator/bin$ sudo ./qtcreator
There is absolutely no reason for being root here. Don't do it !
Quote:
Originally Posted by
val
To get the qtcreator to find the qwt plugin, I can copy a qwt plugin.so to one of qt's several designer folders:
Even if the docs of the Qt creator suggest this: my mantra is "configure instead of copying":
Code:
export QT_PLUGIN_PATH=/usr/local/qwt-6.1.0-qt4/plugins
qtcreator&
Quote:
Originally Posted by
val
qwt creates two plugin files:
/usr/local/qwt-6.1.0/plugins/designer/libqwt_designer_plugin.so 150.7 kB
/usr/local/qwt-6.1.0/designer/plugins/designer/libqwt_designer_plugin.so 195.1 kB
No it doesn't - the second one looks like a path you find in the source tree of Qwt. Looks like you didn't follow the install instructions properly and now you have something messed up:
Again my mantra: "don't copy files aound":
Quote:
Originally Posted by
val
I crossed my fingers and put CONFIG += qwt in my .pro file but this did not resolve the link error.
This will only work if you follow the install guide and will probably fail when copying around files manually !
But assuming you have a proper installation now ( see my final comment below ) you can simply add the following line to your project file:
Code:
include ( /usr/local/qwt-6.1.0/features/qwt.prf )
This has the same effect as "CONFIG += qwt" beside that you don't have to configure qmake. When this is working and you prefer to use "CONFIG += qwt" read https://qt-project.org/doc/qt-5.0/qt...ation-features ( and of course the install guide of Qwt, where this all is explained.
A final comment: my guess is that you have untared and built Qwt in /usr/local and the build and then installed into the same directory. Instead untar and build Qwt somewhere in /home/user - only doing "make install" as root.
Uwe
Re: Ubuntu 13.04 and qwt/qtcreator troubles
Hi,
Just wondering if you have got it working? I am having the similar problems, the only way I can see qwt in qt is to manualy copy all files from install dir (/usr/local/qwt-6.1.0) into qt directories (where I gues it finds it) and I can see widgets but when I debug/ run will fail (I actually forgot what the message got too frustrated and got rid of it).
I can not understand why simple plugin install have to be so hard?
Re: Ubuntu 13.04 and qwt/qtcreator troubles
Quote:
Originally Posted by
myval
I can not understand why simple plugin install have to be so hard?
When dealing with plugins and shared libraries you have to know and understand a couple of things - unfortunately the Qt creator is not very helpful with finding out reasons why something fails.
- I recommend to remove all what you did so far and install Qwt with "qmake + make + make install".
- Do a "ldd /usr/local/qwt-6.1.0/plugins/designer/libqwt_designer_plugin.so" and "ldd /usr/bin/qtcreator" and compare if both are resolving the same Qt and Qwt libs.
- Start a shell and do: export "QT_PLUGIN_PATH=/usr/local/qwt-6.1.0/plugins; /usr/bin/qtcreator"
On Linux it doesn't matter which libs have been built in debug or release mode - you can mix like you want to.
Uwe