Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QAxObject and linker error LNK2019

    General and Desktop
    3
    7
    3311
    Loading More Posts
    • 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
      pelumu last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • P
          pelumu last edited by

          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 Reply Quote 0
          • D
            dbzhang800 last edited by

            [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 Reply Quote 0
            • P
              pelumu last edited by

              QT += axcontainer
              doesn't help.

              In which manual can I find this Information?

              1 Reply Last reply Reply Quote 0
              • D
                dbzhang800 last edited by

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

                1 Reply Last reply Reply Quote 0
                • P
                  pelumu last edited by

                  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 Reply Quote 0
                  • First post
                    Last post