QT5编写和调用DLL动态库的终极实践(5)
发布时间:2021-06-11
发布时间:2021-06-11
QT5编写和调用DLL动态库的终极实践
在po.pro文件中加入LIBS+=..\dll.DLL,完整代码如下:
#-------------------------------------------------
#
# Project created by QtCreator 2013-08-06T10:19:12
# LIBS+="D:\c\po\dll.dll"
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = po
TEMPLATE = app
LIBS+=..\dll.DLL
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h \
dll.h \
dll_global.h
FORMS += mainwindow.ui
在mainwindo.ui加一个按纽,并添加单击槽函数。完整代码如下: #include "mainwindow.h"