QT添加openssl的方法



Assuming Windows you can download its installation from Win32 OpenSSL Installation Project page. You need to download this one for 64-bit windows developing or this one for 32-bit. Just run the stup and every thing will be done easily. The default installation directory is : C:\OpenSSL-Win32
In Qt creator if want to link a library to your project you can just add this line to your .pro file(project file ) :

LIBS += -L/path/to -llibname

So here's what we do for this library( for example to link ubsec.lib )

LIBS += -LC:/OpenSSL-Win32/lib -lubsec

Pay attention to -L and -l.See this question. You don't even need to specify .lib at the end of the library name.

For including .h files add this line to your .pro file :

INCLUDEPATH += C:/OpenSSL-Win32/include

after that you can include a file like this :

#include <openssl/aes.h>
转自:http://stackoverflow.com/questions/14681012/how-to-include-openssl-in-qt-creator
PS:外国社区的人答题就是认真仔细啊!值得学习!

你可能感兴趣的:(QT添加openssl的方法)