Importing .dll into Qt

后端 未结 3 1061
情话喂你
情话喂你 2020-12-15 02:26

I want to bring a .dll dependency into my Qt project.

So I added this to my .pro file:

win32 {
LIBS += C:\\lib\\dependency.lib
LIBS += C:\\lib\\depe         


        
3条回答
  •  盖世英雄少女心
    2020-12-15 02:33

    You need to make the function's declaration available to the linker as well as providing the path to the dll in which it's located. Usually this is done by #including a header file that contains the declaration.

    You also don't need the Q_DECL_IMPORT macro in the client - this would be used in a Qt library's header to allow client apps to import the function. A class or function would be conditionally exported/imported depending on whether the library or a client is being built. More info can be found on this page.

    Is your dependency a third party dll or something that you've created?

提交回复
热议问题