C ++ dll import qt project
-
@hancan007 Which build system are you using,
qmake
orcmake
?https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
-
-
@hancan007 being sure that the external library is compiled accordingly just add external dynamic library, remember to set INCLUDENPATH in the pro file and
#include
the header file where appropriate in your code.If Qt is offering you lib file then most likely you are looking for the static one.
-
@hancan007 said in C ++ dll import qt project:
should i choose internal lib.
Choose "Internal Library" if the library is part of your project.
Choose "External Library" if the library is outside your project.
I want to add ".dll" but qt is looking for my additions as ".lib"
Usually a DLL comes with a .lib file and a .h file.
If you don't have a .lib file -- where did you get this DLL from?
-
Hi
The .h defines what can be called and classes
The LIB file tells what DLL has exported
The DLL contains the actual code.So it can't just use the H.
It needs all of it to work.And most important the DLL must be made with a compatible compiler to what your app is using.
So if made with visual studio, you cannot use MinGW and reverse.
-
@hancan007
Since there is a dll, i think its dynamicSo points to the LIB file and see. it should tell it to load the DLL at run time.
but this only works if same compilers.
-
@hancan007 said in C ++ dll import qt project:
I found the .lib file how should I add it to my project
Earlier you said 'I want to add ".dll" but qt is looking for my additions as ".lib"'. So tell Qt Creator where to find your .lib file.