0
我在Windows 7機器上使用基於QT 5.0.2的QT Creator 2.7.0,並嘗試使用三個子項目創建子項目。使用這裏的例子How to use qmakes subdirs templateQt無法打開Lib文件 - LNK1104無法打開文件'DbManager.lib'
Project_Dir
- DbManager
- Gui
- Build
,我創建了下面列出的項目文件,然而,在建設我不斷收到錯誤LNK1104 Cannot open file 'DbManager.lib'
我的搜索通常yeilds爲Visual Studio類型的修復效果,但沒有QT修復
Project.pro
TEMPLATE = subdirs
SUBDIRS += \
DbManager \
Gui
CONFIG += ordered
SUBDIRS += Build
DbManager.pro
! include(../common.pri) {
error(Couldnt find the common.pri file!)
}
HEADERS += dbmanager.h
SOURCES += dbmanager.cpp
Gui.pro
! include(../common.pri) {
error(Couldnt find the common.pri file!)
}
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = target
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
Build.pro
TEMPLATE = app
DEPENDPATH += ../Gui
INCLUDEPATH += ../Gui
DEPENDPATH += ../DbManager
INCLUDEPATH += ../DbManager
LIBS += -L../DbManager -L../Gui -lDbManager -lGui
SOURCES += main.cpp
TARGET = ../OptionsTrader
QT += widgets
下 「Common.pri」 的文件,也包括:
INCLUDEPATH += . ..
WARNINGS += -Wall
TEMPLATE = lib
UI_DIR = uics
MOC_DIR = mocs
OBJECTS_DIR = objs