Qt QtCreator 所有版本官方下载地址

如何在QT Creator加入lib库文件,在.pro文件中操作,两种方式:

一、写代码

CONFIG(release, debug|release) {
  DESTDIR = release
  OBJECTS_DIR = release/obj
  MOC_DIR = release/moc
  RCC_DIR = release/res
  UI_DIR = release/ui
}
CONFIG(debug, debug|release) {
  DESTDIR = debug
  OBJECTS_DIR = debug/obj
  MOC_DIR = debug/moc
  RCC_DIR = debug/res
  UI_DIR = debug/ui
}
win32: DEFINES += _CRT_SECURE_NO_WARNINGS
macx: INCLUDEPATH += /usr/X11/include /opt/local/include
INCLUDEPATH += $$PWD/../../mpcore/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../mpcore/lib/jpeglib/release -ljpeglib -L$$PWD/../../mpcore/lib/zlib/release -lzlib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../mpcore/lib/jpeglib/debug -ljpeglib -L$$PWD/../../mpcore/lib/zlib/debug -lzlib
else:macx: LIBS += -L/opt/local/lib -ljpeg -lz
macx {
LIBS += -L$$PWD/../../mpcore/lib \
        -lMP \
        -lMPU \
        -lmpe \
        -lanalyzer \
        -lsynth
}
win32 {
LIBS += -L$$PWD/../../mpcore/lib \
        -lmp_runtime \
        -lsynth
}
macx {
  MACDEPLOYQT = $(join $(dir $(QMAKE)), macdeployqt)
  QMAKE_POST_LINK += cp -R $$PWD/resources/* $(dir $(TARGET));
#  QMAKE_POST_LINK += $$MACDEPLOYQT $(abspath $(join $(dir $(TARGET)), ../..))
}
win32 {
  QMAKE_POST_LINK += xcopy /E /F \"$$PWD/resources/*\" \"$$OUT_PWD/release/\"
}
二、空白处,右键 ->外部库
--------------------- 
作者:一个阳光的好孩子 
来源:CSDN 
原文:https://blog.csdn.net/moneyhoney123/article/details/76531605 
版权声明:本文为博主原创文章,转载请附上博文链接!

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页