kiss-o-matic
kiss-o-matic

Reputation: 1181

Qt 5.5 (Q_ENUM causing compile error)

I've just upgraded Qt from 5.3.2 to 5.5.0. A project (which uses QAbstractTableModel) which compiles just fine in 5.3.2 does not compile in 5.5.0, reporting the following error (numerous times):

/usr/local/Qt-5.5.0/include/QtCore/qabstractitemmodel.h:241: error: ISO C++     forbids declaration of 'Q_ENUM' with no type [-fpermissive]
     Q_ENUM(LayoutChangeHint)
                        ^

The errors are entirely in Qt's files, not mine. I'm using gcc491. Below is a few interesting bits from my project file. Any ideas?

TEMPLATE = app
TARGET = MyApp
QT += core widgets gui
QMAKE_CXXFLAGS += -g -std=c++11

Upvotes: 3

Views: 1839

Answers (2)

Magooslum
Magooslum

Reputation: 1

I ran into the same problem after upgrading to Qt5.5 on my Mac. It turned out that I had, at some time, installed QT via homebrew. I tried to do a 'brew update' but even though it updated QT5, the problem persisted... and after searching I found that there may be issues outstanding.

To fix the problem I uninstalled QT via Homebrew (brew uninstall qt) AND I uninstalled QT using the 'MaintenanceTool' app that was in my QT install directory. Then I reinstalled Qt5.5 again using the online installer tool. That sequence finally did the job.

It appears to be necessary to make sure that the old QT libraries / links are gone so that the Qt5.5 installer can set up the ones so that they are found properly. Those old symbolic links that Homebrew left in were somehow not being updated or replaced by the Qt5.5 installer. I found that out after repeated failures. Hopefully this saves someone else the headache that I've developed.

Upvotes: 0

kiss-o-matic
kiss-o-matic

Reputation: 1181

Bonehead move. In QtCreator I pointed to the 5.5.0 version of qmake, but in the .project file 5.3.2 was still in the INCLUDEPATH.

Upvotes: 1

Related Questions