Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QAxObject and linker error LNK2019
Forum Updated to NodeBB v4.3 + New Features

QAxObject and linker error LNK2019

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pelumu
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pelumu
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dbzhang800
          wrote on last edited by
          #4

          [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.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pelumu
            wrote on last edited by
            #5

            QT += axcontainer
            doesn't help.

            In which manual can I find this Information?

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dbzhang800
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pelumu
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved