Important: Please read the Qt Code of Conduct -

[solved] Can't compile with Qt 5.1.1

  • My problems getting my project up and running from Qt 4.8 to Qt 5.1.1 continue. When I try to compile my program, I get the following error (and 18 others, but this is the first):

    /usr/local/Qt5.1.1/5.1.1/clang_64/include/QtWidgets/qscrollerproperties.h:56: error: variable has incomplete type 'class Q_WIDGETS_EXPORT'
    class Q_WIDGETS_EXPORT QScrollerProperties

    I include <QtWidgets> and I added widgets to the QT += line in my .pro file as specified in the guide to transitioning from Qt4.x to Qt5.x am I missing something else? I'm using Qt Creator 2.8.1 on Max OS 10.8 if that helps any.

  • QT += line ? Guess you mean QT += widgets, than it should work

  • Yeah, sorry I don't know why it says QT += line, but my .pro file does have QT += widgets and it still isn't working. The next error is complaining about a forward declaration of Q_WIDGETS_EXPORT and the next few are complaining about QScrollerProperties being an undeclared identifier. So it seems like Q_WIDGETS_EXPORT isn't getting defined anywhere, so the QScrollerProperties class is also not getting declared correctly.

  • Ok Sorry silly question: did you cleaned up, removed all makefiles and run qmake again? or maybe you have some qt 4.x libs in the PATH

  • Yeah, I've cleaned it and ran qmake several times now. It is possible that there are 4.x libs in the PATH because I previously had trouble with Qt Creator refusing to even compile with the 5.1.1. libs, it kept compiling with 4.8 although I thought I had that sorted out.
    I don't want to delete the 4.8 libs because I need to ensure that I can compile this project. If 5.1.1 breaks too many things I won't have time to fix them and still keep up with deadlines and project needs. I've set it to use 5.1.1 in every option dialog I've found though. And from the error message, it certainly appears to be looking in the 5.1.1 directory.

  • Okay, I figured out what was going on. You were right, it was getting conflicted with 4.x libs. I am using a third party framework, so I added /Library/Frameworks to the path but there are some Qt 4.8 frameworks in there and they seemed to bugger things up. I moved the third party framework to a different directory and linked to that one instead. There are still come kinks to work out but at least I'm past that hurdle.

Log in to reply