Results 1 to 2 of 2

Thread: Export Qt stuff from DLL goes wrong

  1. #1
    Join Date
    Jan 2008
    Posts
    56
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Export Qt stuff from DLL goes wrong

    Hi all,

    I made a DLL which worked fine until I integrated some Qt stuff.
    Now, it compiles fine, but some methods are not found inside the DLL, namely those which use Qt (e.g. have a QList as return value).
    I read a bit about exporting Qt in a DLL but don't find my error.
    I use
    qmake -project -t vclib
    qmake -tp vc
    to generate a vc2005 project and then compile.
    Further, I use

    Qt Code:
    1. #ifdef HD2COMM_EXPORTS
    2. #define HD2COMM_API Q_DECL_EXPORT //__declspec(dllexport)
    3. #define EXPIMP_TEMPLATE
    4. #else
    5. #define HD2COMM_API Q_DECL_IMPORT //__declspec(dllimport)
    To copy to clipboard, switch view to plain text mode 
    with HD2COMM_EXPORTS defined

    in my header file.
    Preprocessor definitions are
    _WINDOWS,UNICODE,WIN32,QT_LARGEFILE_SUPPORT,QT_DLL ,QT_GUI_LIB,QT_CORE_LIB,QT_THREAD_SUPPORT

    When I look at the DLL with the dependency walker, I find that e.g. these functions

    Qt Code:
    1. class QList<class CHD2Input *> CRoutingManager::GetListInputs(void)
    2. class QList<class CHD2Output *> CRoutingManager::GetListOutputs(void)
    To copy to clipboard, switch view to plain text mode 
    are not available whereas others are. However, I don't get any link error.
    But when I start the application which uses the DLL, I get a message, that a function is not found in the DLL.

    Any help is appreciated.

    Thanks in advance,

    Rainer

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Export Qt stuff from DLL goes wrong

    Did you include <QtGlobal> or any other Qt header in the file which defines HD2COMM_API?
    J-P Nurmi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.