cxx-qt
cxx-qt copied to clipboard
Windows Compile Error - Too many input files specified
I was working through the getting started book and ran into an error when I got to the point of building. So, to make sure it was nothing I did I grabbed the example from https://github.com/KDAB/cxx-qt/tree/main/examples/cargo_without_cmake
The only change I made was to the cargo.toml -- replacing the dependencies sections with the following:
[dependencies]
cxx = "1.0.110"
cxx-qt = "0.6.0"
cxx-qt-lib = "0.6.0"
[build-dependencies]
cxx-qt-build = { version = "0.6", features = [ "link_qt_object_files" ] }
Upon cargo run I get:
--- stderr
thread 'main' panicked at 'moc failed for M:\ProjectFolder\target\debug\build\qml-minimal-no-cmake-2d740819407cd4a8\out/cxx-qt-gen/qobject.cxxqt.h:
moc: Too many input files specified: 'Files/QT' 'Windows' 'Desktop' '6.6.1' 'win64_mingw/6.6.1/mingw_64/include/QtNetwork' 'Files/QT' 'Windows' 'Desktop' '6.6.1' 'win64_mingw/6.6.1/mingw_64/include/QtCore' 'Files/QT' 'Windows' 'Desktop' '6.6.1' 'win64_mingw/6.6.1/mingw_64/include/QtGui' 'Files/QT' 'Windows' 'Desktop' '6.6.1' 'win64_mingw/6.6.1/mingw_64/include/QtQml' 'Files/QT' 'Windows' 'Desktop' '6.6.1' 'win64_mingw/6.6.1/mingw_64/include' 'M:\M:\ProjectFolder\target\debug\build\qml-minimal-no-cmake-2d740819407cd4a8\out/cxx-qt-gen/qobject.cxxqt.h'
', C:\Users\UserName\.cargo\registry\src\index.crates.io-6f17d22bba15001f\qt-build-utils-0.6.0\src\lib.rs:569:13
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:593
1: core::panicking::panic_fmt
at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\panicking.rs:67
2: qt_build_utils::QtBuild::moc
3: cxx_qt_build::CxxQtBuilder::build
4: __ImageBase
5: core::ops::function::FnOnce::call_once
QT was installed with aqtinstall and the path to its bin was added to the system paths.
qmake --version returns:
QMake version 3.1
Using Qt version 6.6.1 in C:/QT Windows Desktop 6.6.1 win64_mingw/6.6.1/mingw_64/lib
Any assistance would be appreciated.
Thanks for taking the time to report this issue
Looks like something went wrong in the build side and it has decided to pass a load of folders to moc
.
Are you able to provide a minimal example of the source code to the problem so that we can try to reproduce ?
I also note that you are using mingw_64
currently we only test with msvc2019
, so maybe that is worth checking whether this is just a mingw specific issue but it seems more likely to be our build system.
Thanks for the reply.
The source code is the example repo mentioned above with the one specified change in the cargo.yaml
As for mingw_64 -- its possible I chose poorly. I'm new to cxx and to qt and to incorporating c++ libraries in this way. I will see if I can switch to msvc2019 and see if that works.
Thanks again!
Thanks! I'll also try and check if I can reproduce the issue when next on Windows :-)
There were spaces in the path to the QT libraries bin folder and moc wasn't parsing them correctly. When I removed them this error was gone.
I'll leave it to you guys to decide what to do with this issue. :)
Thanks for the responses.
And also for the record, and for future readers, switching qt to win64_msvc2019_64
seems to have resolved some other issues I was having as well. :)
Is there a chat or discord community somewhere we can talk with people about this project?
C:/QT Windows Desktop 6.6.1 win64_mingw/6.6.1/mingw_64/lib
How did you install Qt? Using the official Qt binary installer? Is that a path that it uses by default?
Install info is in OP -- you set the path you want. Best practices for windows have these in "Program Files". But in any case -- windows is a space-laden OS. :D
Is there a chat or discord community somewhere we can talk with people about this project?
@NotGovernor Note we now have https://cxx-qt.zulipchat.com :-)
Thank you. :)