-
Notifications
You must be signed in to change notification settings - Fork 76
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
Following the book to make the first build work is difficult. #676
Comments
Hi, thank you for the feedback, it's super valuable, sorry this was such a painful experience for you. Regarding the issues with the book; we're up for a new release in the near future, so having this feedback is great, we will use this issue as a short list of things to fix when the new release comes up. (Just a few new features left). For the rest of what you described, that tells me that we do need to test more thoroughly on Windows. The issues with the readme seem to stem from the |
Sure thing. Here's from fresh git repo (7ee22a9) First Then So it's somehow trying to link Release and Debug code. Trying with Trying to run it (note the extra "Release" vs Readme)
Then we have to add the bin to PATH, otherwise it won't find the dlls: However, still gives weird problems, ("even though it was found"?).
Trying with copying manually:
Nope:
At this point I've kind of given up. I think I got it working when I was trying to build the qml_minimal more manually using the system Qt from C:\Qt. But this should give you some idea. Also for the |
I'd also be interested in the output of the following example you posted with
Note that we assume that qmake (the Qt bin folder) is in the PATH. And yes Have you tried if launching from QtCreator helps at all as if a kit is used there it ensures that the environment is correct when running the app as well ? |
I didn't try with QtCreator yet. Basically, my first post was me trying to follow the book and use Qt 6.5.1 from system install. The second post was me trying to follow the Readme from the repository. Although I did now notice that I think I had the system Qt in PATH, but I don't think that matters too much, but it does solve the mystery of the platform plugins. Just in case I removed the PATH, moved the system install to another path so there's no way cmake or anything else finds it and ran everything from scratch: The reason I realized I was using the wrong windeployqt is that unlike the normal installation, in the vcpkg one windeployqt.exe and all the Qml dlls are in separate folders, so I actually had to do
However, after that I got a new error:
It seems windeployqt expects Qt6Qml to be found in the same bin directory as the others. I think this means windeployqt in the vcpkg might be broken. (Just for completeness, this is what happens if I run windeployqt from the system install and with
I do have to say this is an interesting assumption, since it seems like even though the readme mentions Qt as requirement, it also seems to be promising that on Windows Qt is installed from vcpkg. (And if it is installed from vcpkg, why would it be a requirement to be installed normally as well?) So I'm not entirely sure what would be the expected path for the user to take if they want to use the default vcpkg route. Should they also install the exact same matching version of Qt and put it in PATH, or should they add the three vcpkg bin folders to PATH. (Which, if done globally, also kind of defeats the benefit of having a project-local install under cxx-qt.) It seems the vcpkg route is not that easy, and it can get interference from system installation that people interested in using Qt with Rust probably have, so maybe it shouldn't be the default, at least until it's fool-proof? I would suggest just telling people to install Qt normally (preferably with link), and then have couple of lines about adding things to PATH and maybe setting env |
This look like a typical windows user story with Qt and CMake.
Checkout the screenshot for reference in my PR. CMake could take care of those point easily.
Then in your second row of problems: |
So the I've also spent some time fixing my Windows setup and have no confirmed that things at least work and run in a certain scenario. I have
With this setup QtCreator can configure, build, and run targets from CMake. And from the command line i can run I've not tried vcpkg yet, we use this mainly for CI, and hoped it would help developers on macOS and Windows setup faster - but maybe it confuses matters having it on in CMake by default. I'll try to using the setup with |
First thing to note is I'm on Windows.
I tried following the book to build the example. It didn't really work:
cxx = "1.0.83"
here instead!" is a bit silly. Why does the book give me code that doesn't work and then tells me to fix it?After setting Cargo.toml to get the crates from the repository instead, I got it to build, but running was difficult:
Actually, I might as well write it here, (I can make a new issue too), but following the instructions on the Readme.md also had problems:
cmake -S . -B build
was fine, but I needed to do the same Release thing withcmake --build build --config Release
./build/examples/qml_minimal/Release/example_qml_minimal.exe
not./build/examples/qml_minimal/example_qml_minimal.exe
like mentionedHonestly at this point I don't know if there's some unmentioned global configuration thing that should be done by some installer, that I haven't done.
Sorry for a bit of a ranty thing. I appreciate the work, and thought you should know what the experience is like.
The text was updated successfully, but these errors were encountered: