QT 在开发项目中遇到的问题 动态库生成不了lib文件

动态库生成不了lib文件

环境:win7 + QT5

QT5在开发中在编译动态库时,未生成lib文件,遇到的主要的问题是没写路径,所以没有在相应的路径下生成相应的lib文件。

解决方案:在pro文件中添加相应路径,如下所示:

pro文件

INCLUDEPATH += ../../include/base/httpserver \
 ../../include/base/universalconfig \
 ../../include/base/log \
 ../../include/base/sysapi \
 ../dmssvr
CONFIG(debug, debug|release){
TARGET = phoneService_d
LIBS += -L../../../lib_d \
 -lsysapi_d \
 -luniversalconfig_d \
 -llog_d \
 -lhttpserver_d
 
  
 
  
MOC_DIR = ../../../obj_d/phoneService/.moc #moc文件路径
OBJECTS_DIR = ../../../obj_d/phoneService/.obj #obj文件路径
UI_DIR = ../../../obj_d/phoneService/.ui #ui文件路径
RCC_DIR = ../../../obj_d/phoneService/.qrc #rcc文件路径
DESTDIR += ../../../lib_d #程序路径
DLLDESTDIR = ../../../bin_d #dll路径 #程序路径
}
else{
TARGET = phoneService
LIBS += -L../../../lib \
 -lsysapi \
 -luniversalconfig \
 -llog \
 -lhttpserver
 
  
MOC_DIR = ../../../obj/phoneService/.moc #moc文件路径
OBJECTS_DIR = ../../../obj/phoneService/.obj #obj文件路径
UI_DIR = ../../../obj/phoneService/.ui #ui文件路径
RCC_DIR = ../../../obj/phoneService/.qrc #rcc文件路径
DESTDIR += ../../../lib #程序路径
DLLDESTDIR = ../../../bin #dll路径
}

你可能感兴趣的:(QT)