我正在尝试在 Linux 操作系统(Ubuntu 13.10)下以调试和 Release模式构建我的 qt-plugin,但在我看来 qmake 忽略了 CONFIG += debug_and_release 选项。我也尝试过使用 CONFIG += build_all,但没有成功。当我在 Windows 上使用相同的选项时,Qt 生成了两个输出文件(例如 plugin.a 和 plugind.a),但在 Linux 上我只得到其中一个。当我强制 QtCreator 以相反模式(调试而不是 relesae)构建我的项目时,它会用具有相同名称的文件覆盖已经生成的目标文件。我哪里出错了?
最佳答案
也许问题是在您的 .pro 文件中您应该设置不同的目标目录或不同的目标文件名。我不知道为什么,但看起来在 Windows 上生成到您的 Makefile 中的目标文件名是不同的,而在 Linux 上它们没有不同。您可以尝试更改目标目录或目标文件名以进行调试构建。 试试看
CONFIG(release, debug|release) {
TARGET = plugin
} else {
TARGET = plugind
}
或
CONFIG(release, debug|release) {
DESTDIR = release
OBJECTS_DIR = release/.obj
MOC_DIR = release/.moc
RCC_DIR = release/.rcc
UI_DIR = release/.ui
} else {
DESTDIR = debug
OBJECTS_DIR = debug/.obj
MOC_DIR = debug/.moc
RCC_DIR = debug/.rcc
UI_DIR = debug/.ui
}
关于linux - debug_and_release 选项不适用于 linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21570560/