Closed fverneau closed 1 month ago
Hi @fverneau! :slightly_smiling_face: I committed the fix for the missing files on the v2.0
branch.
I'm not really sure about the 2nd problem. Those two methods, .staticMetaObject()
and .tr()
, I think are supposed to be Qt generated. So, I would check whether Qt actually generates them and adds them to the DLL.
Hi @bluetiger9, staticMetaObject et tr depend of QObject. Is there a problem with the QObject class ? Thank you very much for your help
Hi, Despite all my efforts, I still have this problem : main.obj:-1: error: LNK2019: unresolved external symbol "public: static struct QMetaObject const SmtpClient::staticMetaObject" (?staticMetaObject@SmtpClient@@2UQMetaObject@@B) referenced in function "public: static class QString __cdecl SmtpClient::tr(char const ,char const ,int)" (?tr@SmtpClient@@SA?AVQString@@PEBD0H@Z) The DLL cannot be used in another project at this time. Any help would be welcome.
Hello, I compiled the library with Qt 6.6.1 and MSVC2019 and I obtained two files "SmtpMime2.dll" and "SmtpMime2.lib". Everything is OK so far.
In my project, I added the following lines in my .PRO:
DEFINES += SMTP_MIME_LIBRARY win32: LIBS += -L$$PWD/smtp/ -lSmtpMime2 INCLUDEPATH += $$PWD/smtp DEPENDPATH += $$PWD/smtp
For information, the .LIB and the .DLL are in an "smtp" subdirectory of my project.
The file "main.cpp" contains :
include ".\smtp\src\SmtpMime"
NB : The files .h and .cpp of SmtpClient are in .\smtp\src\ subdirectory of my project.
When I compile my project, I get these error messages:
main.obj:-1: error: LNK2019: unresolved external symbol "public: virtual cdecl MimeByteArrayAttachment::~MimeByteArrayAttachment(void)" (??1MimeByteArrayAttachment@@UEAA@XZ) reference in the function "public: virtual void * cdecl MimeByteArrayAttachment::`vector deleting destructor'(unsigned int)" (??_EMimeByteArrayAttachment@@UEAAPEAXI@Z) => OK, solved, in .PRO of SmtpClient it is necessary to add : SOURCES += \ ... mimebytearrayattachment.cpp \
HEADERS += \ ... mimebytearrayattachment.h \
main.obj:-1: error: LNK2019: unresolved external symbol "public: static struct QMetaObject const SmtpClient::staticMetaObject" (?staticMetaObject@SmtpClient@@2UQMetaObject@@B) referenced in function "public: static class QString __cdecl SmtpClient::tr(char const ,char const ,int)" (?tr@SmtpClient@@SA?AVQString@@PEBD0H@Z)
=> partially solved : add QObject:: in front staticMetaObject in file "SmtpClient.cpp" :
ifdef QT_NO_DEBUG
else
endif
What is missing ? Thank you very much in advance for your help