Skip to content

Following the book to make the first build work is difficult. #676

Open
@ajantti

Description

@ajantti

First thing to note is I'm on Windows.
I tried following the book to build the example. It didn't really work:

  1. First it wouldn't find Qt (and if you follow the book, Qt is not automatically downloaded). The book should at least explain how to make CMake understand where Qt is.
  2. Of course the whole thing with "# Use 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?
  3. Then I ran into problems with _ITERATOR_DEBUG_LEVEL not matching, signaling that half is being built in Debug config and half in Release, so I had to build it with --config Release, and I still don't know how to make a debug build.
  4. At this point I figured I'd try to use the example from the repository, so I copied the files from the link given in the book instead. But then I ran into problems with cxx_qt_build::QmlModule not existing. Turns out the book tells me to use the stable versions of the crates, but then links to the development branch of the repo for "check this link if anything doesn't work". (Maybe would be a good idea to make the book link to the latest release tags that is connected to the book.)
    After setting Cargo.toml to get the crates from the repository instead, I got it to build, but running was difficult:
  5. First it had problems with not finding the .dlls. So I added them to PATH.
  6. Then it wouldn't find the platform plugins.
  7. Then it wouldn't find the qml files.
  8. Of course all these would be solved by running windeployqt, but the given CMakeLists.txt doesn't seem to be handling that, and following CMake's instructions didn't work for me either, so I gave up and ran it manually.
  9. Then I even had problems with the qrc. I don't know exactly why the AUTORCC is not working, but shouldn't it be added as a file in the CMakeLists.txt?

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:

  1. Running cmake -S . -B build was fine, but I needed to do the same Release thing with cmake --build build --config Release
  2. After that, the exe was in ./build/examples/qml_minimal/Release/example_qml_minimal.exe not ./build/examples/qml_minimal/example_qml_minimal.exe like mentioned
  3. And then I got the same stuff as before about platform plugins.

Honestly 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    📖 documentationImprovements or additions to documentation🔨 build systemIssues related to integrating CXX-Qt into CMake/Cargo🪲 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions