gpt4 book ai didi

c++ - Qt Creator : add custom build configuration settings in . 专业版

转载 作者:搜寻专家 更新时间:2023-10-31 01:01:06 24 4
gpt4 key购买 nike

我正在尝试为自定义构建配置添加build设置。

默认情况下,Qt Creator 创建debugrelease 配置(http://doc.qt.digia.com/qtcreator-2.4/creator-build-settings.html)。

对于这些配置,您可以添加自定义build设置。例如:

release: DESTDIR = $${build_root_dir}/release
debug: DESTDIR = $${build_root_dir}/debug

我在 Qt Creator 中创建了另一个名为 debug_menu_active 的构建配置。我想使用相同类型的语句:

debug_menu_active: DEFINES += FORCE_ACTIVE_MENU_DEBUG
debug_menu_active: DESTDIR = $${build_root_dir}/debug_menu_active

不幸的是,它不起作用 message("DEFINES: "$${DEFINES}) 给出:

Project MESSAGE: DEFINES :UNICODE QT_LARGEFILE_SUPPORT

我想我需要定义其他东西,但我不知道它可能是什么。

有人可以帮我吗?

谢谢!

更新:

我测试了@svlasov 的回答,但不幸的是它破坏了编译:

qtinternal\moc\moc_scenario.cpp:10:154: error: scenario.h: No such file or directory
qtinternal\moc\moc_scenario.cpp:12:2: error: #error "The header file 'scenario.h' doesn't include <QObject>."
qtinternal\moc\moc_scenario.cpp:20: error: expected constructor, destructor, or type conversion before 'static'
qtinternal\moc\moc_scenario.cpp:48: error: 'scenario' has not been declared
qtinternal\moc\moc_scenario.cpp:48: error: variable or field 'qt_static_metacall' declared void
qtinternal\moc\moc_scenario.cpp:48: error: 'QObject' was not declared in this scope
qtinternal\moc\moc_scenario.cpp:48: error: '_o' was not declared in this scope
qtinternal\moc\moc_scenario.cpp:48: error: 'QMetaObject' has not been declared
qtinternal\moc\moc_scenario.cpp:48: error: expected primary-expression before 'int'
qtinternal\moc\moc_scenario.cpp:48: error: expected primary-expression before 'void'

这是我的做法: enter image description here

最佳答案

Build Steps 下,为 qmake 步骤设置 Additional arguments 为:

CONFIG+=debug_menu_active

关于c++ - Qt Creator : add custom build configuration settings in . 专业版,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29772897/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com