本文主要是介绍warning: Automatically turning off nmake‘s inference rules. (CONFIG += no_batch)无法直接在QtCreator中新建筛选器,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Qt系列文章目录
文章目录
- Qt系列文章目录
- 前言
- 一、警告原因
- 二、无法直接在QtCreator新建过滤器
- 在QtCreator中创建解决方案
- 加入qml文件
前言
warning: F:/QtExercise/QWidgetQml/main.cpp conflicts with F:/QtExercise/QWidgetQml/src/main.cpp
warning: Automatically turning off nmake’s inference rules. (CONFIG += no_batch)
warning: F:/QtExercise/QWidgetQml/main.cpp conflicts with F:/QtExercise/QWidgetQml/src/main.cpp
warning: Automatically turning off nmake’s inference rules. (CONFIG += no_batch)
一、警告原因
工程中有2个同名的文件,比方说2个main.cpp
二、无法直接在QtCreator新建过滤器
我们使用visual studio时候,经常在项目中新建过滤器,而在QtCreator中无法新建过滤器。
新建中没有创建“新建筛选器”的选项
在QtCreator中创建解决方案
- 首先在QtCreator创建一个空项目
2.手动创建pro文件,里面包含工程,我这里分别包含了3个工程:
(1)PublishBlogManager
(2)SubscribEventHandle
(3)Test
TEMPLATE = subdirsCONFIG += orderedSUBDIRS += \PublishBlogManager \SubscribEventHandle \Test
3.分别为
(1)PublishBlogManager
(2)SubscribEventHandle
(3)Test
这3个工程创建pro文件
PublishBlogManager .pro
QT += core
QT -= guiTEMPLATE = lib
CONFIG += plugin
TARGET = PublishBlogManager
DESTDIR=../output/bin/plugins//头文件路径
INCLUDEPATH += $$PWD/../include/Core \+= $$PWD/../include/PluginFramework \+= $$PWD/../include/Widgets//源码安装路径
INCLUDEPATH += $$PWD/../ctkInstall/Libs/PluginFramework \+= $$PWD/../ctkInstall/Libs/Core \+= $$PWD/../ctkInstall/Libs/Widgets//静态库路径
LIBS += -L$$PWD/../libs -lCTKCore -lCTKPluginFramework -lCTKWidgetsHEADERS += \BlogManager.h \BlogManagerActivator.hSOURCES += \BlogManager.cpp \BlogManagerActivator.cppRESOURCES += \Resource.qrc
SubscribEventHandle .pro
QT += core
QT -= guiTEMPLATE = lib
CONFIG += plugin
TARGET = SubscribEventHandle
DESTDIR=../output/bin/plugins//头文件路径
INCLUDEPATH += $$PWD/../include/Core \+= $$PWD/../include/PluginFramework \+= $$PWD/../include/Widgets//源码安装路径
INCLUDEPATH += $$PWD/../ctkInstall/Libs/PluginFramework \+= $$PWD/../ctkInstall/Libs/Core \+= $$PWD/../ctkInstall/Libs/Widgets//静态库路径
LIBS += -L$$PWD/../libs -lCTKCore -lCTKPluginFramework -lCTKWidgetsHEADERS += \BlogEventHandler.h \BlogEventHandlerActivator.hSOURCES += \BlogEventHandler.cpp \BlogEventHandlerActivator.cppRESOURCES += \Resource.qrc
Test.pro
#-------------------------------------------------
#
# Project created by QtCreator 2020-07-29T16:35:18
#
#-------------------------------------------------QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgetsTARGET = Test
TEMPLATE = app
DESTDIR=../output/bin/plugins# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0CONFIG += c++11//头文件路径
INCLUDEPATH += $$PWD/../include/Core \+= $$PWD/../include/PluginFramework \+= $$PWD/../include/Widgets//源码安装路径
INCLUDEPATH += $$PWD/../ctkInstall/Libs/PluginFramework \+= $$PWD/../ctkInstall/Libs/Core \+= $$PWD/../ctkInstall/Libs/Widgets//静态库路径
LIBS += -L$$PWD/../libs -lCTKCore -lCTKPluginFramework -lCTKWidgetsSOURCES += \main.cpp \MainWindow.cppHEADERS += \MainWindow.hFORMS += \MainWindow.ui# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
加入qml文件
加入qml文件会自动生成qml筛选器
这篇关于warning: Automatically turning off nmake‘s inference rules. (CONFIG += no_batch)无法直接在QtCreator中新建筛选器的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!