Home c++ How to add * .dll in Qt?

How to add * .dll in Qt?

Author

Date

Category

Try Add a link to DLL in the project QT . Previously downloaded the lib for MINIGW.

Content 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 trial to induclude Luba – Writes No Such File or Directory


Answer 1, Authority 100%

includepath + = $$ PWD / D: / TEST / SODIUM / INCLUDE
Dependpath + = $$ PWD / D: / TEST / SODIUM / INCLUDE

This is $$ PWD – means the directory in which the PRO file is located.

Use:

includepath + = d: / test / sodium / include
DependPath + = D: / Test / Sodium / Include

or

includepath + = $$ pwd / .. relative_put__file
Dependpath + = $$ PWD / .. Relative_Put_K_Falam

for libraries – similar to

For libsodium-win32 library: I downloaded and unpacked, in my case the Bin / include / lib folder is located in D: \ Newfolder \ Libsodium-win32

in Pro file Write:

includepath + = d: \ newfolder \ libsodium-win32 \ include
DependPath + = D: \ NewFolder \ Libsodium-win32 \ include
LIBS + = -LD: \ NEWFolder \ libSodium-win32 \ lib -llibsodium

after which this code is normally compiled

# include & lt; sodium.h & gt;
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 CRYPTO_HASH_SHA256 function must be transmitted correct values, and not in my example. Since in this case the program will “fall” when trying to start.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions