Skip to content
The Chat Archive
gpt-3.5-turbo-0301· OpenAI WildChat-4.8M (AI2)

qt5 pro文件中 引入dll的写法

  1. User

    qt5 pro文件中 引入dll的写法

  2. Assistant

    在qt5的pro文件中引入dll的写法如下:

    TEMPLATE = app
    TARGET = MyApp
    CONFIG += qt
    SOURCES += main.cpp
    
    # 添加INCLUDEPATH
    INCLUDEPATH += mydll
    
    # 添加LIBS指向DLL路径和DLL名称 
    LIBS += -L$$PWD/mydll -lmydll
    

    其中,-L表示库文件(.lib)所在的路径,-l表示库文件的名称。

    请根据实际情况修改 INCLUDEPATH 和 LIBS 的值。