Why dll created by Qt Creator is different from normal dll (unmanaged)

0

Reacently I tried to use a dll built in visual studio. After hard try I successfully compiled it and got some a dll and some header files. However when I tried to use that dll in Qt Creator, it always tell me "undefined reference to `_imp___"

I have to wonder whether my dll is correctly compiled or not. So I use DLL Export Viewer to check my dll.

My dll's function:

bool __cdecl MsgPack::registerPacker(int,signed char,class QByteArray (__cdecl*)(class QVariant const & __ptr64))   0x0000000180001280  0x00001280  50 (0x32)   qmsgpack.dll    C:\Users\Ivy\Desktop\Qt Project\Test\Test\qmsgpack.dll  Exported Function   
bool __cdecl MsgPack::registerType(enum QMetaType::Type,unsigned char)  0x0000000180001290  0x00001290  51 (0x33)   qmsgpack.dll    C:\Users\Ivy\Desktop\Qt Project\Test\Test\qmsgpack.dll  Exported Function   
bool __cdecl MsgPack::registerUnpacker(signed char,class QVariant (__cdecl*)(class QByteArray const & __ptr64)) 0x00000001800012a0  0x000012a0  52 (0x34)   qmsgpack.dll    C:\Users\Ivy\Desktop\Qt Project\Test\Test\qmsgpack.dll  Exported Function   
class MsgPackStream & __ptr64 __cdecl operator<<(class MsgPackStream & __ptr64,class QDate const & __ptr64) 0x00000001800078b0  0x000078b0  27 (0x1b)   qmsgpack.dll    C:\Users\Ivy\Desktop\Qt Project\Test\Test\qmsgpack.dll  Exported Function   
class MsgPackStream & __ptr64 __cdecl operator<<(class MsgPackStream & __ptr64,class QDateTime const & __ptr64) 0x00000001800079d0  0x000079d0  28 (0x1c)   qmsgpack.dll    C:\Users\Ivy\Desktop\Qt Project\Test\Test\qmsgpack.dll  Exported Function   
class MsgPackStream & __ptr64 __cdecl operator<<(class MsgPackStream & __ptr64,class QPoint const & __ptr64)    0x0000000180008150  0x00008150  29 (0x1d)   qmsgpack.dll    C:\Users\Ivy\Desktop\Qt Project\Test\Test\qmsgpack.dll  Exported Function   
class MsgPackStream & __ptr64 __cdecl operator<<(class MsgPackStream & __ptr64,class QRect const & __ptr64) 0x0000000180008260  0x00008260  30 (0x1e)   qmsgpack.dll    C:\Users\Ivy\Desktop\Qt Project\Test\Test\qmsgpack.dll  Exported Function   
class MsgPackStream & __ptr64 __cdecl operator<<(class MsgPackStream & __ptr64,class QSize const & __ptr64) 0x00000001800083d0  0x000083d0  31 (0x1f)   qmsgpack.dll    C:\Users\Ivy\Desktop\Qt Project\Test\Test\qmsgpack.dll  Exported Function   

But, a dll(lib) created by qt, which can be linked well,looks like this

_ZN8Untitled4FOOkEv 0x6a9413d0  0x000013d0  1 (0x1) untitled.dll    C:\Users\Ivy\Desktop\Qt Project\build-untitled-Desktop_Qt_5_12_3_MinGW_64_bit-Release\release\untitled.dll  Exported Function   
_ZN8UntitledC1Ev    0x6a9413c0  0x000013c0  2 (0x2) untitled.dll    C:\Users\Ivy\Desktop\Qt Project\build-untitled-Desktop_Qt_5_12_3_MinGW_64_bit-Release\release\untitled.dll  Exported Function   
_ZN8UntitledC2Ev    0x6a9413c0  0x000013c0  3 (0x3) untitled.dll    C:\Users\Ivy\Desktop\Qt Project\build-untitled-Desktop_Qt_5_12_3_MinGW_64_bit-Release\release\untitled.dll  Exported Function   

And no wonder when I try to link to the normal dll, it fail to link.

I check some other dlls in the system and none of their function name begin with some strange underline-mixed words.

Does anyone can explain this?

c++
qt
dll
asked on Stack Overflow Apr 28, 2019 by T.Worm • edited Apr 28, 2019 by T.Worm

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0