QtCreator plugin compilation error — invalid use of incomplete type 'class QAAction'

  • I am trying to compile (against qt 5.4.2) and I keep getting this error. Is there a version mismatch?

    I am frankly a bit surprised by how hard it is to install a plugin in QtCreator. I need to find the QtCreator source, plug-in source, point paths and everything (more difficult if you don't have admin and has to download everything by yourself) to the right version, compile myself, and install. While in many IDEs it's just a few mouse clicks. am I not doing this right?

    The plugin I am trying to install is this, in case anybody wonders:

    ../qtcreator-tabbededitor-plugin/tabsforeditorswidget.cpp: In constructor 'TabbedEditor::Internal::TabsForEditorsWidget::TabsForEditorsWidget(QWidget*)':
    ../qtcreator-tabbededitor-plugin/tabsforeditorswidget.cpp:54:73: error: invalid use of incomplete type 'class QAction'
      QAction *prevTabAction = new QAction(tr("Switch to previous tab"), this);
    In file included from ../../../username/bin/Qt5.4.2/5.4/gcc_64/include/QtWidgets/QWidget:1:0,
                     from ../qtcreator-tabbededitor-plugin/tabsforeditorswidget.h:5,
                     from ../qtcreator-tabbededitor-plugin/tabsforeditorswidget.cpp:1:
    ../../../username/bin/Qt5.4.2/5.4/gcc_64/include/QtWidgets/qwidget.h:61:7: error: forward declaration of 'class QAction'
     class QAction;

  • in tabsforeditorswidget.cpp add #include <QAction>

  • Thanks, now I am getting errors like
    cannot find -lCore
    cannot find -lTextEditor
    cannot find -lAggregation
    cannot find -lExtensionSystem
    cannot find -lUtils

    Where can I obtain those libraries?

    @VRonin said:

    #include <QAction>

  • in your .pro file, do you have QT += core gui widgets ?

  • Added it and still failed.

    # Qt Creator linking
    QTC_PLUGIN_NAME = TabbedEditor
        extensionsystem \
        coreplugin \
    QT += core gui widgets
    ## set the QTC_SOURCE environment variable to override the setting here
    isEmpty(QTCREATOR_SOURCES):error("Error. QTC_SOURCE variable must point to Qt Creator sources.")
    ## set the QTC_BUILD environment variable to override the setting here
    isEmpty(IDE_BUILD_TREE):error("Error. QTC_BUILD variable must point to Qt Creator build directory.")
    ## uncomment to build plugin into user config directory
    ## <localappdata>/plugins/<ideversion>
    ##    where <localappdata> is e.g.
    ##    "%LOCALAPPDATA%\QtProject\qtcreator" on Windows Vista and later
    ##    "$XDG_DATA_HOME/data/QtProject/qtcreator" or "~/.local/share/data/QtProject/qtcreator" on Linux
    ##    "~/Library/Application Support/QtProject/Qt Creator" on Mac
    # USE_USER_DESTDIR = yes
    # TabbedEditor files
    SOURCES += \
        tabbededitorplugin.cpp \
    HEADERS += \
        tabbededitorplugin.h \
        tabbededitorconstants.h \
    RESOURCES += \
    CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT

    @VRonin said:

    QT += core gui widgets

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.