c++ - Qt 编译器警告 : overriding commands for target/ignoring old commands for target

标签 c++ qt qmake moc

当我为 Windows 编译我的 Qt 项目时,我收到以下 2 个警告:

Makefile.Debug:109: warning: overriding commands for target `debug/moc_mainwindow.cpp'
Makefile.Debug:106: warning: ignoring old commands for target `debug/moc_mainwindow.cpp'

我假设他们表明我的项目配置存在问题,问题是什么以及如何解决?

最佳答案

我曾经遇到过同样的错误,也许你的问题的来源不同,但我还是会写。 在我的 *.pro 文件中,它就像:

SOURCES += main.cpp\
    mainwindow.cpp\
    serialHelper.cpp \
serialHelper.cpp

HEADERS  += mainwindow.h\
     += serialHelper.h \
serialHelper.h \
typeDefinitions.h

cpp 和头文件在重复。我删除了重复的包含并为我解决了问题。

关于c++ - Qt 编译器警告 : overriding commands for target/ignoring old commands for target,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4722400/

相关文章:

qt - qml中如何断开一个信号的方法?

linux - 如何在 qmake 中设置库顺序?

c++ - qmake 不添加小部件

c++ - 将函数/方法指针推送到双端队列

c++ - 用户定义的转换是否将派生类类型转换为基类类型?

c++ - 如何在 QUrl 中设置主机路径?

Qt@5.5 有效,但 Qt 无效

c++ - 如果在成员中抛出异常,则删除母对象

c++ - Visual Studio : how to handle project dependencies right?

c++ - 通过终端创建项目文件并编译失败,但通过 Qt Creator IDE 工作正常