1

all I'm trying to create ActiveX server with Qt5.2.0. According to some pieces of information I have, to create a simple ActiveX server (which exports one object) it's enough to:

  1. have such .pro file

    TEMPLATE = lib
    CONFIG  += dll axserver
    TARGET = simpleServer
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                                      QT += core
    RC_FILE = qaxserver.rc
    DEF_FILE = qaxserver.def
    
    HEADERS += myserver.h
    
    SOURCES += main.cpp
    SOURCES += myserver.cpp
    
  2. have such main.cpp file

    #include "ActiveQt/QAxFactory"

    #include "myserver.h"

    QAXFACTORY_DEFAULT( MyServer, 5 id's )

  3. the class should inherit QWidget and QAxBindable

  4. there should be file qaxserver.rc. in my case it's content is 1 TYPELIB "simpleServer.pro"

  5. there should be fie qaxserver.def with default contents:

    ; mfc_test.def : Declares the module parameters.
    
    EXPORTS
    
    DllCanUnloadNow      PRIVATE
    
    DllGetClassObject    PRIVATE
    
    DllRegisterServer    PRIVATE
    
    DllUnregisterServer  PRIVATE
    
    DumpIDL              PRIVATE
    

the problem is that these 5 names are undefined for Visual Studio's linker. How to solve the problem?

the error is:

error LNK2001: unresolved external symbol DllCanUnloadNow
Illia Levandovskyi
  • 1,228
  • 1
  • 11
  • 20

1 Answers1

1

need to add QT += axserver in .pro file

Illia Levandovskyi
  • 1,228
  • 1
  • 11
  • 20