added necessary QT_DECL_EXPORT/QT_DECL_IMPORT to be able to build a DLL on windows

This commit is contained in:
Andreas Mützel 2014-09-01 09:59:57 +02:00
parent 076034a612
commit a4f4235139
14 changed files with 53 additions and 15 deletions

View File

@ -7,8 +7,13 @@
QT += core gui network QT += core gui network
TARGET = SMTPEmail TARGET = SMTPEmail
TEMPLATE = app
TEMPLATE = app
# uncomment this to build a shared library
#TEMPLATE = lib
#CONFIG += dll
DEFINES += SMTP_BUILD
SOURCES += \ SOURCES += \
src/emailaddress.cpp \ src/emailaddress.cpp \
@ -37,7 +42,8 @@ HEADERS += \
src/SmtpMime \ src/SmtpMime \
src/quotedprintable.h \ src/quotedprintable.h \
src/mimemultipart.h \ src/mimemultipart.h \
src/mimecontentformatter.h src/mimecontentformatter.h \
src/smtpexports.h
OTHER_FILES += \ OTHER_FILES += \
LICENSE \ LICENSE \

View File

@ -21,7 +21,9 @@
#include <QObject> #include <QObject>
class EmailAddress : public QObject #include "smtpexports.h"
class SMTP_EXPORT EmailAddress : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -23,7 +23,9 @@
#include "mimepart.h" #include "mimepart.h"
#include "mimefile.h" #include "mimefile.h"
class MimeAttachment : public MimeFile #include "smtpexports.h"
class SMTP_EXPORT MimeAttachment : public MimeFile
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -22,7 +22,9 @@
#include <QObject> #include <QObject>
#include <QByteArray> #include <QByteArray>
class MimeContentFormatter : public QObject #include "smtpexports.h"
class SMTP_EXPORT MimeContentFormatter : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -22,7 +22,9 @@
#include "mimepart.h" #include "mimepart.h"
#include <QFile> #include <QFile>
class MimeFile : public MimePart #include "smtpexports.h"
class SMTP_EXPORT MimeFile : public MimePart
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -21,7 +21,9 @@
#include "mimetext.h" #include "mimetext.h"
class MimeHtml : public MimeText #include "smtpexports.h"
class SMTP_EXPORT MimeHtml : public MimeText
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -21,7 +21,9 @@
#include "mimefile.h" #include "mimefile.h"
class MimeInlineFile : public MimeFile #include "smtpexports.h"
class SMTP_EXPORT MimeInlineFile : public MimeFile
{ {
public: public:

View File

@ -24,7 +24,9 @@
#include "emailaddress.h" #include "emailaddress.h"
#include <QList> #include <QList>
class MimeMessage : public QObject #include "smtpexports.h"
class SMTP_EXPORT MimeMessage : public QObject
{ {
public: public:

View File

@ -21,7 +21,9 @@
#include "mimepart.h" #include "mimepart.h"
class MimeMultiPart : public MimePart #include "smtpexports.h"
class SMTP_EXPORT MimeMultiPart : public MimePart
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -22,7 +22,9 @@
#include <QObject> #include <QObject>
#include "mimecontentformatter.h" #include "mimecontentformatter.h"
class MimePart : public QObject #include "smtpexports.h"
class SMTP_EXPORT MimePart : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -21,7 +21,9 @@
#include "mimepart.h" #include "mimepart.h"
class MimeText : public MimePart #include "smtpexports.h"
class SMTP_EXPORT MimeText : public MimePart
{ {
public: public:

View File

@ -22,7 +22,9 @@
#include <QObject> #include <QObject>
#include <QByteArray> #include <QByteArray>
class QuotedPrintable : public QObject #include "smtpexports.h"
class SMTP_EXPORT QuotedPrintable : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -23,9 +23,9 @@
#include <QtNetwork/QSslSocket> #include <QtNetwork/QSslSocket>
#include "mimemessage.h" #include "mimemessage.h"
#include "smtpexports.h"
class SMTP_EXPORT SmtpClient : public QObject
class SmtpClient : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

10
src/smtpexports.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef SMTPEXPORTS_H
#define SMTPEXPORTS_H
#ifdef SMTP_BUILD
#define SMTP_EXPORT Q_DECL_EXPORT
#else
#define SMTP_EXPORT Q_DECL_IMPORT
#endif
#endif // SMTPEXPORTS_H