Important: Please read the Qt Code of Conduct -

Regarding QAxBase & QAxObject

  • Hi All

    I have created a QT Console Application, but when i include QAxBase & QAxObject header files it gives me following
    error C1083: Cannot open include file: 'QAxBase': No such file or directory

    My code:
    #include <QtCore/QCoreApplication>
    #include <QAxBase>
    #include <QAxObject>
    #include <objbase.h>
    #include <unknwn.h>
    #include <QUuid>
    int main(int argc, char *argv[])
    QCoreApplication a(argc, argv);
    return a.exec();

    How to resolve this error.

  • Could you post your .pro file contents?

    I thing you forgot to add support there for the module.

  • AFAIK, you have to add Qt += activeqt in the pro file.

  • According to the "docs": it should be

    CONFIG += qaxcontainer

    in the .pro.

  • Excuse me for bringing up such an old thread from the museum, but it's the first google hit when searching for

    Qt5 QAxObject: No such file or directory

    So, if someone gets here with the same problem but on Qt 5:

    1 - on your .pro, add:
    CONFIG += axcontainer
    (it was qaxcontainer on qt 4)
    and "axcontainer" to the QT += line too

    2 - on the includes use
    #include <ActiveQt/QAxBase>
    #include <ActiveQt/QAxObject>

    Joao S Veiga

Log in to reply