Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Compile Error - Too many input files specified #756

Open
NotGovernor opened this issue Nov 26, 2023 · 9 comments
Open

Windows Compile Error - Too many input files specified #756

NotGovernor opened this issue Nov 26, 2023 · 9 comments
Labels
🪲 bug Something isn't working 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo

Comments

@NotGovernor
Copy link

NotGovernor commented Nov 26, 2023

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.

@ahayzen-kdab ahayzen-kdab added 🪲 bug Something isn't working 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo labels Nov 27, 2023
@ahayzen-kdab
Copy link
Collaborator

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.

@NotGovernor
Copy link
Author

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!

@ahayzen-kdab
Copy link
Collaborator

Thanks! I'll also try and check if I can reproduce the issue when next on Windows :-)

@NotGovernor
Copy link
Author

NotGovernor commented Nov 28, 2023

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.

@NotGovernor
Copy link
Author

NotGovernor commented Nov 28, 2023

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?

@Be-ing
Copy link
Contributor

Be-ing commented Nov 29, 2023

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?

@NotGovernor
Copy link
Author

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

@ahayzen-kdab
Copy link
Collaborator

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 :-)

@NotGovernor
Copy link
Author

Thank you. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo
Projects
None yet
Development

No branches or pull requests

3 participants