Results 1 to 16 of 16

Thread: Qwt with CMake

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2020
    Posts
    53
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Qwt with CMake

    I tried adding Qt6Gui and Qt6Core, and all kinds of reordering, but to no avail. I have no problem using Qt Charts, so the issue must be related to Qwt.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,323
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qwt with CMake

    Are you sure you are building qwt against your Qt6 installation? Can you successfully use qwt in a project built with QtCreator? (I know these are "Have you checked to see if it is plugged in?" questions, but I've done things like this in the past, where I have had mismatched builds and nothing seems to work).

    It is MOC that results in all of the QMetaType references so something could be wrong with your qwt build.
    <=== 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.

  3. #3
    Join Date
    Jan 2020
    Posts
    53
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Qwt with CMake

    I am not absolutely sure I am building Qwt corectly. I built Qwt thus:
    /usr/bin/qmake qwt.pro
    make
    sudo make install

    The strange thing is that all the examples supplied with Qwt works perfectly when build by QtCreator.

    The file qwtconfig.pri starts of with:
    QWT_VER_MAJ = 6
    QWT_VER_MIN = 2
    QWT_VER_PAT = 0
    QWT_VERSION = $${QWT_VER_MAJ}.$${QWT_VER_MIN}.$${QWT_VER_PAT}
    which looks correct to me.

    I do not know if it is relevant, but qwt.pro has this information at the start:
    lessThan(QT_MAJOR_VERSION, 5) {

    lessThan(QT_MINOR_VERSION, 8) {
    error(Qt >= 4.8 required.)
    }
    }

    include( qwtconfig.pri )

    The version 5 here probably refers to Qt 5.15.3 used by Kubuntu 22.04?
    qmake --version
    returns
    QMake version 3.1
    Using Qt version 5.15.3 in /usr/lib/x86_64-linux-gnu

    I noticed that there is also qmake6, which returns:
    qmake6 --version
    QMake version 3.1
    Using Qt version 6.2.4 in /usr/lib/x86_64-linux-gnu

    So I tried:
    make clean
    /usr/bin/qmake6 qwt.pro
    make
    sudo make install
    but the problem persists.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,323
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qwt with CMake

    What do you see when you run this?
    Qt Code:
    1. ldd -d -r libqwt.so
    To copy to clipboard, switch view to plain text mode 
    Does it show dependencies on any of the Qt6 libraries?

    How about opening the qwt.pro file in QtCreator and ensuring that you are building using a Qt6 kit?

    I am afraid I am not really a linux developer, so this is getting to the limits of my knowledge and experience.
    <=== 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.

  5. #5
    Join Date
    Jan 2020
    Posts
    53
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Qwt with CMake

    I see:
    Qt Code:
    1. ldd: ./libqwt.so: No such file or directory
    To copy to clipboard, switch view to plain text mode 
    Q
    I then created a link:
    Qt Code:
    1. ln -s /usr/local/qwt-6.2.0/lib/libqwt.so.6.2.0 libqwt.so
    To copy to clipboard, switch view to plain text mode 
    but it made no difference. But output like
    Qt Code:
    1. /usr/bin/ld: /usr/local/qwt-6.2.0/lib/libqwt.so: undefined reference to `QtPrivate::QMetaTypeInterfaceWrapper<QVariant>::metaType@Qt_6'
    To copy to clipboard, switch view to plain text mode 
    indicated that the lib is found. It also indicates that qwt v. 6.2.0 is used, as well as Qt6, so it appears that there isn't a version mismatch. Also, I can build the qwt examples with Qt Creator, so libqwt.so seems to be OK.

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,323
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qwt with CMake

    Well. sorry, but I am at the end of my ideas. I think qmake creates a Makefile, right? (I use Visual Studio on Windows for all my development, which does not use Makefiles). Maybe take a look at one of those for your qwt examples and see if there is something in the linking that is missing from your CMakelists file. Otherwise, I don't know what else to suggest.
    <=== 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.

  7. #7
    Join Date
    Jan 2020
    Posts
    53
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Qwt with CMake

    Yes, cmake creates a makefile, but I don't find any clues there. There is a file called CMakeCache.txt, which includes:
    Qt Code:
    1. Name Value
    2. QWT /usr/local/qwt-6.2.0/lib/libqwt.so
    To copy to clipboard, switch view to plain text mode 
    which is the correct path. Anyway, don't spend more time on this problem. I will keep scratching my head though. One thing I haven't thought about before: does qmake use hard-coded paths?

  8. #8
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,323
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qwt with CMake

    cmake creates a makefile
    No, I meant qmake. Check the Makefile from that to see if there are any ideas about what could be wrong with the cmake configuration.
    <=== 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. Qt Creator Qt SDK 1.1.3 and CMake on Mac OS X 10.7.1 / Lion
    By agarny in forum Qt Tools
    Replies: 2
    Last Post: 3rd August 2012, 08:56
  2. Cmake
    By R.CH in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2010, 17:06
  3. QT linguist Cmake
    By _Jack_ in forum Qt Programming
    Replies: 1
    Last Post: 18th September 2010, 11:29
  4. using moc with cmake
    By Isaac in forum Newbie
    Replies: 2
    Last Post: 29th May 2008, 03:10
  5. CMake and pthreads
    By Matt Smith in forum General Discussion
    Replies: 5
    Last Post: 3rd September 2006, 20:42

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
  •  
Qt is a trademark of The Qt Company.