Results 1 to 4 of 4

Thread: Ubuntu 13.04 and qwt/qtcreator troubles

  1. #1
    Join Date
    Dec 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy 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.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,278
    Thanked 872 Times in 820 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Ubuntu 13.04 and qwt/qtcreator troubles

    Quote Originally Posted by val View Post
    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 View Post
    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 View Post
    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 View Post
    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":

    Qt Code:
    1. export QT_PLUGIN_PATH=/usr/local/qwt-6.1.0-qt4/plugins
    2. qtcreator&
    To copy to clipboard, switch view to plain text mode 


    Quote Originally Posted by val View Post
    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 View Post
    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:

    Qt Code:
    1. include ( /usr/local/qwt-6.1.0/features/qwt.prf )
    To copy to clipboard, switch view to plain text mode 
    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

  3. #3
    Join Date
    Dec 2013
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default 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?

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,278
    Thanked 872 Times in 820 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Ubuntu 13.04 and qwt/qtcreator troubles

    Quote Originally Posted by myval View Post
    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.


    1. I recommend to remove all what you did so far and install Qwt with "qmake + make + make install".
    2. 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.
    3. 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

Similar Threads

  1. Using QtCreator on Ubuntu
    By feraudyh in forum Newbie
    Replies: 2
    Last Post: 2nd March 2011, 17:07
  2. FFMPEG Troubles
    By khrave in forum Qt Programming
    Replies: 0
    Last Post: 23rd June 2010, 00:15
  3. troubles with QPainter
    By halmassi in forum Newbie
    Replies: 1
    Last Post: 14th February 2010, 13:12
  4. Big troubles when deploying on Mac
    By NoRulez in forum Installation and Deployment
    Replies: 0
    Last Post: 11th February 2010, 15:27
  5. Replies: 10
    Last Post: 13th November 2009, 19:31

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.