How do I add *. dll to Qt?

I'm trying to add a link to dll in the Qt project. Pre-downloaded libu for MiniGW.

Contents of the pro - file

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/D:/test/sodium/lib/ -lsodium
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/D:/test/sodium/lib/ -lsodiumd
else:unix: LIBS += -L$$PWD/D:/test/sodium/lib/ -lsodium

INCLUDEPATH += $$PWD/D:/test/sodium/include
DEPENDPATH += $$PWD/D:/test/sodium/include

win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/D:/test/sodium/lib/libsodium.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/D:/test/sodium/lib/libsodiumd.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/D:/test/sodium/lib/sodium.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/D:/test/sodium/lib/sodiumd.lib
else:unix: PRE_TARGETDEPS += $$PWD/D:/test/sodium/lib/libsodium.a

I try to zainkludit libu-writes No such file or directory

enter a description of the image here

Author: Radzhab, 2016-06-30

1 answers

INCLUDEPATH += $$PWD/D:/test/sodium/include
DEPENDPATH += $$PWD/D:/test/sodium/include

Here it is here $ $ PWD-means the directory where the pro file is located.

Use it:

INCLUDEPATH += D:/test/sodium/include
DEPENDPATH += D:/test/sodium/include

Or

INCLUDEPATH += $$PWD/..относительный_путь_к_файлам
DEPENDPATH += $$PWD/..относительный_путь_к_файлам

For libraries-similar to

For the libsodium-win32 library: downloaded and unpacked, in my case the bin/include/lib folders are located in D:\newfolder\libsodium-win32

In the pro file, we write:

INCLUDEPATH += D:\newfolder\libsodium-win32\include
DEPENDPATH += D:\newfolder\libsodium-win32\include

LIBS += -LD:\newfolder\libsodium-win32\lib -llibsodium

After that, this code is normally compiled

#include <sodium.h>

int main(int argc, char *argv[])
{
    unsigned char *ch1 = 0;
    unsigned char *ch2 = 0;

    crypto_hash_sha256(ch1, ch2, 1000);

    return 0;
}

It is clear that the correct values must be passed to the crypto_hash_sha256 function, not like in my example. Since in this case, the program will "crash" when trying to start.

 4
Author: Александр, 2016-06-30 13:00:52