开发者

Qt - Using 3rd party DLLs in my application

I have been trying to get a clear answer on this all morning but I haven't had much luck - maybe I'm being slow as I haven't used this functionality before.

I have a .dll file and also a corresponding .lib file of the same name. I want to use some functions from these with my Qt application. I have a list of the functions available to me in the library and I also have a list of C++ prototypes for these functions (these are written 开发者_开发问答using extern "C").

From what I can understand from today ( might be wrong ) I can either load the library at runtime and attempt to resolve the function I need OR I can load the library at compile time, ensuring that I include the C++ prototypes in my header.

Now, my first question is am I right in thinking those two things?

If I am, is there a preferred way out of these?

If I am wrong - would anyone be able to give me a gentle shove in the right direction?

Thanks


Maybe you need to link .lib statically, deploy dll with your program, include function prototypes and just use functions? Static .libs are often provided so you don't have to do "dirty" work - they load dynamic library and export functions for you. For example Qt is usually used this way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜