【问题标题】:Qt + VS2019 16.7.0: moc: Too many input files specifiedQt + VS2019 16.7.0:moc:指定的输入文件过多
【发布时间】:2020-11-27 18:04:48
【问题描述】:

将 msvc 更新到 16.7.0 版本后,我的项目构建中断。 我看到以下错误:

1> moc: Too many input files specified: 'D:\DevProj\C++\QtLib\src\QtLib\GUI\FramelessWindow.h' 'D:\DevProj\C++\ALib\src' 'D:\DevProj\C++\QtLib\src\' 'D:\libs\leathers\Source'
1> Usage: D:\libs\Qt\Qt.5.14.2\5.14.2\msvc2017_64\bin\moc.exe [options] [header-file] [@option-file]
1> Qt Meta Object Compiler version 67 (Qt 5.14.2)
1> Options:
1>   -?, -h, --help              Displays help on commandline options.
1>   --help-all                  Displays help including Qt specific options.
1>   -v, --version               Displays version information.
1>   -o <file>                   Write output to file rather than stdout.
1>   -I <dir>                    Add dir to the include path for header files.
1>   -F <framework>              Add Mac framework to the include path for header
1>                               files.
1>   -E                          Preprocess only; do not generate meta object
1>                               code.
1>   -D <macro[=def]>            Define macro, with optional definition.
1>   -U <macro>                  Undefine macro.
1>   -M <key=value>              Add key/value pair to plugin meta data
1>   --compiler-flavor <flavor>  Set the compiler flavor: either "msvc" or "unix".
1>   -i                          Do not generate an #include statement.
1>   -p <path>                   Path prefix for included file.
1>   -f <file>                   Force #include <file> (overwrite default).
1>   -b <file>                   Prepend #include <file> (preserve default
1>                               include).
1>   --include <file>            Parse <file> as an #include before the main
1>                               source(s).
1>   -n <which>                  Do not display notes (-nn) or warnings (-nw).
1>                               Compatibility option.
1>   --no-notes                  Do not display notes.
1>   --no-warnings               Do not display warnings (implies --no-notes).
1>   --ignore-option-clashes     Ignore all options that conflict with compilers,
1>                               like -pthread conflicting with moc's -p option.
1> Arguments:
1>   [header-file]               Header file to read from, otherwise stdin.
1>   [@option-file]              Read additional options from option-file.

我在这里找到了 VS2010 的类似问题,答案是路径中不应有空格。但是路径中没有空格。

有人知道为什么会出现上述问题以及如何解决吗?

【问题讨论】:

    标签: qt visual-studio-2019 qt-vs-addin


    【解决方案1】:

    看来,2.6.0.6 版本的 VS Qt Addin 坏了。通过在 Visual Studio 选项中禁用自动扩展更新并恢复到 2.5.1 版本来修复此问题

    正确,但它是fixed in Version 2.6.0.7。

    至少对我来说,这次更新解决了这个问题。

    【讨论】:

      【解决方案2】:

      看来,2.6.0.6 版本的 VS Qt Addin 是broken。通过在 Visual Studio 选项中禁用自动扩展更新并恢复为 2.5.1 version 来修复此问题

      【讨论】:

        猜你喜欢
        • 2012-05-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-02-26
        • 1970-01-01
        • 2010-11-23
        • 1970-01-01
        • 2012-06-29
        相关资源
        最近更新 更多