PDA

View Full Version : Including library



Stank
12th July 2016, 11:29
Hi

I'm using Qt 5.6 on Windows

I'm trying to send-email in my application and wanted to use this (https://github.com/bluetiger9/SmtpClient-for-Qt) library

But I happend to have some trouble including it in any program. I've checked related topics but it didn't help.

I built the porject, and compiled it to get my .a. When I use the Qt tool (or do it myself) to include the library I get this error on compilation : "cannot find -lSMTPEmail".

I'm still new to Qt, so this my just be some basic mistake I make somewhere, sorry if informations are missing

Thanks for your help.
Stank

anda_skoa
12th July 2016, 12:35
Where did you put the .a file?

If it is not in your project, did you add a -L directive in the LIBS variable to point to the other directory?

Cheers,
_

Stank
12th July 2016, 13:34
Hi,

Thanks for your reply.

Here is the code i've added in my .pro file (this one's been added automaticly by QtCreator)

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../SmtpClient-for-Qt/release/ -lSMTPEmail
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../SmtpClient-for-Qt/debug/ -lSMTPEmail
else:unix: LIBS += -L$$PWD/../../SmtpClient-for-Qt/ -lSMTPEmail

INCLUDEPATH += $$PWD/../../SmtpClient-for-Qt/release
DEPENDPATH += $$PWD/../../SmtpClient-for-Qt/release

Thanks,

Stank

anda_skoa
12th July 2016, 14:27
And the library is in one of these directories?

Cheers,
_

Stank
12th July 2016, 14:51
God damit I'm just a morron, I didn't configure the debug kit correctly, and since I only checked release, it messed up the reception folder in Debug mode.
I can now try to fix code issues.
Thanks for your time and opening my eyes

Stank