QAxObject and linker error LNK2019



  • Hi,

    after a pause of 6 years today I tried to develop a OLE-Client with Qt 5.0.2 and Qt Creater.

    When I try to build my application I get 4 LNK2019 Errors refering to QAxObject. Can anybody help me?

    My source code:

    main.cpp:
    #include <QCoreApplication>

    #include <ActiveQt/QAxObject>

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);

    QAxObject broker;
    bool brokerGeladen = broker.setControl("Broker.Application");
    if(brokerGeladen)
    {
        broker.dynamicCall("Quit");
    }
    
    return a.exec&#40;&#41;;
    

    }

    ole.pro:
    #-------------------------------------------------

    Project created by QtCreator 2013-06-26T17:28:09

    #-------------------------------------------------

    QT += core

    QT -= gui

    TARGET = Ole
    CONFIG += console
    CONFIG += qaxcontainer
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you check that you indeed have the QAx related libraries in your Qt installation ?



  • Hi,

    There is no qaxcontainer.lib in the lib Directory but a qt5axcontainer.lib. Using qt5axcontainer in the pro file doesn't help too.
    Tomorrow I'll try it with VS 2012. Perhaps it's Working better.



  • [quote author="pelumu" date="1372281406"]Hi,

    There is no qaxcontainer.lib in the lib Directory but a qt5axcontainer.lib. Using qt5axcontainer in the pro file doesn't help too.
    Tomorrow I'll try it with VS 2012. Perhaps it's Working better.
    [/quote]

    What you need is
    @
    QT += axcontainer
    @
    when using Qt5.

    Please read the manual carefully.

    And note that, CoInitialize() must be called when using COM/ActiveX. Nevertheless, you can omit CoInitialize() when using QApplication, as it has been called by QApplication. COM is needed by drag and drop basic function that provided by Windows.



  • QT += axcontainer
    doesn't help.

    In which manual can I find this Information?



  • Error messages reported by compiler and linker will be helpful ;-)



  • It is working now.

    My steps:
    I uninstalled Qt 5.0.2 for Windows 64-bit (VS 2012, 500 MB) and installed Qt 5.0.2 for Windows 32-bit (VS 2010, 485 MB). Now I could compile it without errors but debugging didn't work.
    Next step I uninstalled VS 2010 version and installed MinGW version.

    With this version I can compile and debug without errors.

    Thank you very much for your help.


Log in to reply
 

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