A
A
Asya2019-10-12 19:04:44
Qt
Asya, 2019-10-12 19:04:44

How to include dll library in QtCreator?

I can connect lib and os libs, but I can't connect dll,
tell me how to do it right?
and how to include it in the code?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly, 2019-10-14
@vt4a2h

If you mean qmake (*.pro file), then:

LIBS *= "path_to_dll"
INCLUDEPATH *= "path_to_headers"

Well, in the code, just disable as usual after that.
With CMake projects it will be different. By the way, soon Qt will officially switch to CMake.

I
ittakir, 2019-10-23
@ittakir

To include a DLL library in a *.pro file, you need to add:
LIBS += full path to the .lib file
Or for system libraries:
LIBS += -lUser32
DLL library consists of .lib, .h and .dll files. .exe needs .lib and .h to build. Then, when you run the .exe, there should be a .dll somewhere nearby.
After changing the pro file, be sure to right-click on the project and run Run Qmake.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question