KDAB / cxx-qt

Safe interop between Rust and Qt
https://kdab.github.io/cxx-qt/book/
1.06k stars 75 forks source link

Cross-compiling CXX-QT application from Linux to Windows #1001

Closed lem0nify closed 3 months ago

lem0nify commented 3 months ago

Excuse me, but I haven't found a better place for such questions. I want to compile the simplest application (say, counter application example from CXX-QT book) for windows using linux. How do I do it?

I've tried just specifying target with --target cargo flag like cargo build --release --target x86_64-pc-windows-gnu but here's what I see:

   Compiling proc-macro2 v1.0.86
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.155
   Compiling thiserror v1.0.63
   Compiling termcolor v1.4.1
   Compiling unicode-width v0.1.13
   Compiling either v1.13.0
   Compiling memchr v2.7.4
   Compiling minimal-lexical v0.2.1
   Compiling cxxbridge-flags v1.0.124
   Compiling unicode-segmentation v1.11.0
   Compiling itertools v0.11.0
   Compiling codespan-reporting v0.11.1
   Compiling scratch v1.0.7
   Compiling cxx-qt-lib-headers v0.6.1
   Compiling nom v7.1.3
   Compiling convert_case v0.6.0
   Compiling indoc v2.0.5
   Compiling once_cell v1.19.0
   Compiling version_check v0.9.4
   Compiling quote v1.0.36
   Compiling static_assertions v1.1.0
   Compiling jobserver v0.1.31
   Compiling syn v2.0.71
   Compiling cc v1.1.6
   Compiling versions v5.0.1
   Compiling link-cplusplus v1.0.9
   Compiling cxx v1.0.124
   Compiling cxx-build v1.0.124
   Compiling cxx-gen v0.7.124
   Compiling thiserror-impl v1.0.63
   Compiling cxxbridge-macro v1.0.124
   Compiling clang-format v0.3.0
   Compiling qt-build-utils v0.6.1
   Compiling cxx-qt-gen v0.6.1
   Compiling cxx-qt-lib v0.6.1
   Compiling cxx-qt-build v0.6.1
   Compiling cxx-qt-macro v0.6.1
   Compiling qcounter v0.1.0 (/home/lem0nify/code/rust/qcounter)
   Compiling cxx-qt v0.6.1
The following warnings were emitted during compilation:

warning: cxx-qt-lib@0.6.1: Could not open /usr/lib/Qt6Core.prl file to read libraries to link: No such file or directory (os error 2)
warning: cxx-qt-lib@0.6.1: Could not open /usr/lib/Qt6Gui.prl file to read libraries to link: No such file or directory (os error 2)
warning: cxx-qt-lib@0.6.1: Could not open /usr/lib/Qt6Qml.prl file to read libraries to link: No such file or directory (os error 2)
warning: cxx-qt-lib@0.6.1: In file included from /usr/include/qt6/QtGui/qguiapplication.h:9,
warning: cxx-qt-lib@0.6.1:                  from /usr/include/qt6/QtGui/QGuiApplication:1,
warning: cxx-qt-lib@0.6.1:                  from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxx-qt-lib/qguiapplication.h:12,
warning: cxx-qt-lib@0.6.1:                  from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/sources/cxx-qt-lib/src/gui/qguiapplication.rs.cc:5:
warning: cxx-qt-lib@0.6.1: /usr/include/qt6/QtGui/qwindowdefs.h:56:12: fatal error: QtGui/qwindowdefs_win.h: No such file or directory
warning: cxx-qt-lib@0.6.1:    56 | #  include <QtGui/qwindowdefs_win.h>
warning: cxx-qt-lib@0.6.1:       |            ^~~~~~~~~~~~~~~~~~~~~~~~~
warning: cxx-qt-lib@0.6.1: compilation terminated.
warning: cxx-qt-lib@0.6.1: ToolExecError: Command "x86_64-w64-mingw32-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate" "-I" "/usr/include/qt6/QtCore" "-I" "/usr/include/qt6/QtGui" "-I" "/usr/include/qt6/QtQml" "-I" "/usr/include/qt6" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out" "-Wall" "-Wextra" "-std=c++17" "-Wa,-mbig-obj" "-DCXX_QT_GUI_FEATURE" "-DCXX_QT_QML_FEATURE" "-o" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/640288ddd7c8d537-qguiapplication.rs.o" "-c" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/sources/cxx-qt-lib/src/gui/qguiapplication.rs.cc" with args x86_64-w64-mingw32-g++ did not execute successfully (status code exit status: 1).cargo:warning=In file included from /usr/include/qt6/QtGui/qpaintdevice.h:8,
warning: cxx-qt-lib@0.6.1:                  from /usr/include/qt6/QtGui/qimage.h:10,
warning: cxx-qt-lib@0.6.1:                  from /usr/include/qt6/QtGui/QImage:1,
warning: cxx-qt-lib@0.6.1:                  from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxx-qt-lib/qimage.h:11,
warning: cxx-qt-lib@0.6.1:                  from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/sources/cxx-qt-lib/src/gui/qimage.rs.cc:1:
warning: cxx-qt-lib@0.6.1: /usr/include/qt6/QtGui/qwindowdefs.h:56:12: fatal error: QtGui/qwindowdefs_win.h: No such file or directory
warning: cxx-qt-lib@0.6.1:    56 | #  include <QtGui/qwindowdefs_win.h>
warning: cxx-qt-lib@0.6.1:       |            ^~~~~~~~~~~~~~~~~~~~~~~~~
warning: cxx-qt-lib@0.6.1: compilation terminated.
warning: cxx-qt-lib@0.6.1: ToolExecError: Command "x86_64-w64-mingw32-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate" "-I" "/usr/include/qt6/QtCore" "-I" "/usr/include/qt6/QtGui" "-I" "/usr/include/qt6/QtQml" "-I" "/usr/include/qt6" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out" "-Wall" "-Wextra" "-std=c++17" "-Wa,-mbig-obj" "-DCXX_QT_GUI_FEATURE" "-DCXX_QT_QML_FEATURE" "-o" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/640288ddd7c8d537-qimage.rs.o" "-c" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/sources/cxx-qt-lib/src/gui/qimage.rs.cc" with args x86_64-w64-mingw32-g++ did not execute successfully (status code exit status: 1).
warning: cxx-qt-lib@0.6.1: In file included from /usr/include/qt6/QtGui/qguiapplication.h:9,
warning: cxx-qt-lib@0.6.1:                  from /usr/include/qt6/QtGui/QGuiApplication:1,
warning: cxx-qt-lib@0.6.1:                  from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxx-qt-lib/qguiapplication.h:12,
warning: cxx-qt-lib@0.6.1:                  from src/gui/qguiapplication.cpp:10:
warning: cxx-qt-lib@0.6.1: /usr/include/qt6/QtGui/qwindowdefs.h:56:12: fatal error: QtGui/qwindowdefs_win.h: No such file or directory
warning: cxx-qt-lib@0.6.1:    56 | #  include <QtGui/qwindowdefs_win.h>
warning: cxx-qt-lib@0.6.1:       |            ^~~~~~~~~~~~~~~~~~~~~~~~~
warning: cxx-qt-lib@0.6.1: compilation terminated.
warning: cxx-qt-lib@0.6.1: ToolExecError: Command "x86_64-w64-mingw32-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate" "-I" "/usr/include/qt6/QtCore" "-I" "/usr/include/qt6/QtGui" "-I" "/usr/include/qt6/QtQml" "-I" "/usr/include/qt6" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out" "-Wall" "-Wextra" "-std=c++17" "-Wa,-mbig-obj" "-DCXX_QT_GUI_FEATURE" "-DCXX_QT_QML_FEATURE" "-o" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/9d38a231359fe1f4-qguiapplication.o" "-c" "src/gui/qguiapplication.cpp" with args x86_64-w64-mingw32-g++ did not execute successfully (status code exit status: 1).cargo:warning=In file included from /usr/include/qt6/QtGui/qpaintdevice.h:8,
warning: cxx-qt-lib@0.6.1:                  from /usr/include/qt6/QtGui/qimage.h:10,
warning: cxx-qt-lib@0.6.1:                  from /usr/include/qt6/QtGui/QImage:1,
warning: cxx-qt-lib@0.6.1:                  from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxx-qt-lib/qimage.h:11,
warning: cxx-qt-lib@0.6.1:                  from src/gui/qimage.cpp:10:
warning: cxx-qt-lib@0.6.1: /usr/include/qt6/QtGui/qwindowdefs.h:56:12: fatal error: QtGui/qwindowdefs_win.h: No such file or directory
warning: cxx-qt-lib@0.6.1:    56 | #  include <QtGui/qwindowdefs_win.h>
warning: cxx-qt-lib@0.6.1:       |            ^~~~~~~~~~~~~~~~~~~~~~~~~
warning: cxx-qt-lib@0.6.1: compilation terminated.
warning: cxx-qt-lib@0.6.1: ToolExecError: Command "x86_64-w64-mingw32-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate" "-I" "/usr/include/qt6/QtCore" "-I" "/usr/include/qt6/QtGui" "-I" "/usr/include/qt6/QtQml" "-I" "/usr/include/qt6" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out" "-Wall" "-Wextra" "-std=c++17" "-Wa,-mbig-obj" "-DCXX_QT_GUI_FEATURE" "-DCXX_QT_QML_FEATURE" "-o" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/9d38a231359fe1f4-qimage.o" "-c" "src/gui/qimage.cpp" with args x86_64-w64-mingw32-g++ did not execute successfully (status code exit status: 1).

error: failed to run custom build command for `cxx-qt-lib v0.6.1`

Caused by:
  process didn't exit successfully: `/home/lem0nify/code/rust/qcounter/target/release/build/cxx-qt-lib-6cce5abebbeb18a9/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=QMAKE
  cargo:rerun-if-env-changed=QT_VERSION_MAJOR
  cargo:rustc-cfg=qt_version_major="6"
  cargo:rerun-if-changed=src/core/qbytearray.rs
  cargo:rerun-if-changed=src/core/qcoreapplication.rs
  cargo:rerun-if-changed=src/core/qdate.rs
  cargo:rerun-if-changed=src/core/qhash/qhash_i32_qbytearray.rs
  cargo:rerun-if-changed=src/core/qhash/qhash_qstring_qvariant.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_bool.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_f32.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_f64.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_i8.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_i16.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_i32.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_i64.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qbytearray.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qdate.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qmargins.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qmarginsf.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qpersistentmodelindex.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qpoint.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qpointf.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qrect.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qrectf.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qsize.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qsizef.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qstring.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qtime.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qurl.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qvariant.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_u8.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_u16.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_u32.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_u64.rs
  cargo:rerun-if-changed=src/core/qmap/qmap_qstring_qvariant.rs
  cargo:rerun-if-changed=src/core/qmargins.rs
  cargo:rerun-if-changed=src/core/qmarginsf.rs
  cargo:rerun-if-changed=src/core/qmetaobjectconnection.rs
  cargo:rerun-if-changed=src/core/qmodelindex.rs
  cargo:rerun-if-changed=src/core/qpersistentmodelindex.rs
  cargo:rerun-if-changed=src/core/qpoint.rs
  cargo:rerun-if-changed=src/core/qpointf.rs
  cargo:rerun-if-changed=src/core/qrect.rs
  cargo:rerun-if-changed=src/core/qrectf.rs
  cargo:rerun-if-changed=src/core/qset/qset_bool.rs
  cargo:rerun-if-changed=src/core/qset/qset_f32.rs
  cargo:rerun-if-changed=src/core/qset/qset_f64.rs
  cargo:rerun-if-changed=src/core/qset/qset_i8.rs
  cargo:rerun-if-changed=src/core/qset/qset_i16.rs
  cargo:rerun-if-changed=src/core/qset/qset_i32.rs
  cargo:rerun-if-changed=src/core/qset/qset_i64.rs
  cargo:rerun-if-changed=src/core/qset/qset_qbytearray.rs
  cargo:rerun-if-changed=src/core/qset/qset_qdate.rs
  cargo:rerun-if-changed=src/core/qset/qset_qpersistentmodelindex.rs
  cargo:rerun-if-changed=src/core/qset/qset_qstring.rs
  cargo:rerun-if-changed=src/core/qset/qset_qtime.rs
  cargo:rerun-if-changed=src/core/qset/qset_qurl.rs
  cargo:rerun-if-changed=src/core/qset/qset_u8.rs
  cargo:rerun-if-changed=src/core/qset/qset_u16.rs
  cargo:rerun-if-changed=src/core/qset/qset_u32.rs
  cargo:rerun-if-changed=src/core/qset/qset_u64.rs
  cargo:rerun-if-changed=src/core/qsize.rs
  cargo:rerun-if-changed=src/core/qsizef.rs
  cargo:rerun-if-changed=src/core/qstring.rs
  cargo:rerun-if-changed=src/core/qstringlist.rs
  cargo:rerun-if-changed=src/core/qt.rs
  cargo:rerun-if-changed=src/core/qtime.rs
  cargo:rerun-if-changed=src/core/qurl.rs
  cargo:rerun-if-changed=src/core/qvariant/mod.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_bool.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_f32.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_f64.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_i8.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_i16.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_i32.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_i64.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qbytearray.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qdate.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qmodelindex.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qpersistentmodelindex.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qpoint.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qpointf.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qrect.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qrectf.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qsize.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qsizef.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qstring.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qstringlist.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qtime.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qurl.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_u8.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_u16.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_u32.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_u64.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_bool.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_f32.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_f64.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_i8.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_i16.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_i32.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_i64.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qbytearray.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qdate.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qmargins.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qmarginsf.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qpersistentmodelindex.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qpoint.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qpointf.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qrect.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qrectf.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qsize.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qsizef.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qstring.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qtime.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qurl.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qvariant.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_u8.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_u16.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_u32.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_u64.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qcolor.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qcolor.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qcolor.rs
  cargo:rerun-if-changed=src/gui/qcolor.rs
  cargo:rerun-if-changed=src/gui/qguiapplication.rs
  cargo:rerun-if-changed=src/gui/qimage.rs
  cargo:rerun-if-changed=src/gui/qvector2d.rs
  cargo:rerun-if-changed=src/gui/qvector3d.rs
  cargo:rerun-if-changed=src/gui/qvector4d.rs
  cargo:rerun-if-changed=src/qml/qqmlapplicationengine.rs
  cargo:rerun-if-changed=src/qml/qqmlengine.rs
  cargo:rerun-if-changed=src/core/qdatetime.rs
  cargo:rerun-if-changed=src/core/qtimezone.rs
  cargo:rerun-if-changed=src/core/qlist/qlist_qdatetime.rs
  cargo:rerun-if-changed=src/core/qset/qset_qdatetime.rs
  cargo:rerun-if-changed=src/core/qvariant/qvariant_qdatetime.rs
  cargo:rerun-if-changed=src/core/qvector/qvector_qdatetime.rs
  cargo:CXXBRIDGE_PREFIX=cxx-qt-lib
  cargo:CXXBRIDGE_LINKS=cxx-qt-lib
  cargo:CXXBRIDGE_DIR0=/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include
  cargo:CXXBRIDGE_DIR1=/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate
  cargo:CXXBRIDGE_DIR2=/usr/include/qt6/QtCore
  cargo:CXXBRIDGE_DIR3=/usr/include/qt6/QtGui
  cargo:CXXBRIDGE_DIR4=/usr/include/qt6/QtQml
  cargo:CXXBRIDGE_DIR5=/usr/include/qt6
  cargo:rustc-link-search=/usr/lib
  cargo:rustc-link-lib=Qt6Core
  cargo:warning=Could not open /usr/lib/Qt6Core.prl file to read libraries to link: No such file or directory (os error 2)
  cargo:rustc-link-lib=Qt6Gui
  cargo:warning=Could not open /usr/lib/Qt6Gui.prl file to read libraries to link: No such file or directory (os error 2)
  cargo:rustc-link-lib=Qt6Qml
  cargo:warning=Could not open /usr/lib/Qt6Qml.prl file to read libraries to link: No such file or directory (os error 2)
  cargo:rerun-if-changed=src/core/qbytearray.cpp
  cargo:rerun-if-changed=src/core/qcoreapplication.cpp
  cargo:rerun-if-changed=src/core/qdate.cpp
  cargo:rerun-if-changed=src/core/qhash/qhash.cpp
  cargo:rerun-if-changed=src/core/qlist/qlist.cpp
  cargo:rerun-if-changed=src/core/qmap/qmap.cpp
  cargo:rerun-if-changed=src/core/qmargins.cpp
  cargo:rerun-if-changed=src/core/qmarginsf.cpp
  cargo:rerun-if-changed=src/core/qmetaobjectconnection.cpp
  cargo:rerun-if-changed=src/core/qmodelindex.cpp
  cargo:rerun-if-changed=src/core/qpersistentmodelindex.cpp
  cargo:rerun-if-changed=src/core/qpoint.cpp
  cargo:rerun-if-changed=src/core/qpointf.cpp
  cargo:rerun-if-changed=src/core/qrect.cpp
  cargo:rerun-if-changed=src/core/qrectf.cpp
  cargo:rerun-if-changed=src/core/qset/qset.cpp
  cargo:rerun-if-changed=src/core/qsize.cpp
  cargo:rerun-if-changed=src/core/qsizef.cpp
  cargo:rerun-if-changed=src/core/qstring.cpp
  cargo:rerun-if-changed=src/core/qstringlist.cpp
  cargo:rerun-if-changed=src/core/qtime.cpp
  cargo:rerun-if-changed=src/core/qurl.cpp
  cargo:rerun-if-changed=src/core/qvariant/qvariant.cpp
  cargo:rerun-if-changed=src/core/qvector/qvector.cpp
  cargo:rerun-if-changed=src/gui/qcolor.cpp
  cargo:rerun-if-changed=src/gui/qguiapplication.cpp
  cargo:rerun-if-changed=src/gui/qimage.cpp
  cargo:rerun-if-changed=src/gui/qvector2d.cpp
  cargo:rerun-if-changed=src/gui/qvector3d.cpp
  cargo:rerun-if-changed=src/gui/qvector4d.cpp
  cargo:rerun-if-changed=src/qml/qqmlapplicationengine.cpp
  cargo:rerun-if-changed=src/qml/qqmlengine.cpp
  cargo:rerun-if-changed=src/core/qdatetime.cpp
  cargo:rerun-if-changed=src/core/qtimezone.cpp
  cargo:rerun-if-changed=src/qt_types.cpp
  cargo:rerun-if-changed=src/assertion_utils.h
  OUT_DIR = Some(/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out)
  TARGET = Some(x86_64-pc-windows-gnu)
  OPT_LEVEL = Some(3)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CXX_x86_64-pc-windows-gnu
  CXX_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXX_x86_64_pc_windows_gnu
  CXX_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=TARGET_CXX
  TARGET_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  RUSTC_LINKER = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(false)
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-gnu
  CXXFLAGS_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_gnu
  CXXFLAGS_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=TARGET_CXXFLAGS
  TARGET_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  OUT_DIR = Some(/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-gnu
  CXXFLAGS_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_gnu
  CXXFLAGS_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=TARGET_CXXFLAGS
  TARGET_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  OUT_DIR = Some(/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-gnu
  CXXFLAGS_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_gnu
  CXXFLAGS_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=TARGET_CXXFLAGS
  TARGET_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  OUT_DIR = Some(/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-gnu
  CXXFLAGS_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_gnu
  CXXFLAGS_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=TARGET_CXXFLAGS
  TARGET_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  OUT_DIR = Some(/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-gnu
  CXXFLAGS_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_gnu
  CXXFLAGS_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=TARGET_CXXFLAGS
  TARGET_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  OUT_DIR = Some(/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-gnu
  CXXFLAGS_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_gnu
  CXXFLAGS_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=TARGET_CXXFLAGS
  TARGET_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  OUT_DIR = Some(/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some(fxsr,sse,sse2)
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-gnu
  CXXFLAGS_x86_64-pc-windows-gnu = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_gnu
  CXXFLAGS_x86_64_pc_windows_gnu = None
  cargo:rerun-if-env-changed=TARGET_CXXFLAGS
  TARGET_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  cargo:warning=In file included from /usr/include/qt6/QtGui/qguiapplication.h:9,
  cargo:warning=                 from /usr/include/qt6/QtGui/QGuiApplication:1,
  cargo:warning=                 from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxx-qt-lib/qguiapplication.h:12,
  cargo:warning=                 from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/sources/cxx-qt-lib/src/gui/qguiapplication.rs.cc:5:
  cargo:warning=/usr/include/qt6/QtGui/qwindowdefs.h:56:12: fatal error: QtGui/qwindowdefs_win.h: No such file or directory
  cargo:warning=   56 | #  include <QtGui/qwindowdefs_win.h>
  cargo:warning=      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=compilation terminated.
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 1
  cargo:warning=ToolExecError: Command "x86_64-w64-mingw32-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate" "-I" "/usr/include/qt6/QtCore" "-I" "/usr/include/qt6/QtGui" "-I" "/usr/include/qt6/QtQml" "-I" "/usr/include/qt6" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out" "-Wall" "-Wextra" "-std=c++17" "-Wa,-mbig-obj" "-DCXX_QT_GUI_FEATURE" "-DCXX_QT_QML_FEATURE" "-o" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/640288ddd7c8d537-qguiapplication.rs.o" "-c" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/sources/cxx-qt-lib/src/gui/qguiapplication.rs.cc" with args x86_64-w64-mingw32-g++ did not execute successfully (status code exit status: 1).cargo:warning=In file included from /usr/include/qt6/QtGui/qpaintdevice.h:8,
  cargo:warning=                 from /usr/include/qt6/QtGui/qimage.h:10,
  cargo:warning=                 from /usr/include/qt6/QtGui/QImage:1,
  cargo:warning=                 from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxx-qt-lib/qimage.h:11,
  cargo:warning=                 from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/sources/cxx-qt-lib/src/gui/qimage.rs.cc:1:
  cargo:warning=/usr/include/qt6/QtGui/qwindowdefs.h:56:12: fatal error: QtGui/qwindowdefs_win.h: No such file or directory
  cargo:warning=   56 | #  include <QtGui/qwindowdefs_win.h>
  cargo:warning=      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=compilation terminated.

  exit status: 1
  cargo:warning=ToolExecError: Command "x86_64-w64-mingw32-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate" "-I" "/usr/include/qt6/QtCore" "-I" "/usr/include/qt6/QtGui" "-I" "/usr/include/qt6/QtQml" "-I" "/usr/include/qt6" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out" "-Wall" "-Wextra" "-std=c++17" "-Wa,-mbig-obj" "-DCXX_QT_GUI_FEATURE" "-DCXX_QT_QML_FEATURE" "-o" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/640288ddd7c8d537-qimage.rs.o" "-c" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/sources/cxx-qt-lib/src/gui/qimage.rs.cc" with args x86_64-w64-mingw32-g++ did not execute successfully (status code exit status: 1).
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  cargo:warning=In file included from /usr/include/qt6/QtGui/qguiapplication.h:9,
  cargo:warning=                 from /usr/include/qt6/QtGui/QGuiApplication:1,
  cargo:warning=                 from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxx-qt-lib/qguiapplication.h:12,
  cargo:warning=                 from src/gui/qguiapplication.cpp:10:
  cargo:warning=/usr/include/qt6/QtGui/qwindowdefs.h:56:12: fatal error: QtGui/qwindowdefs_win.h: No such file or directory
  cargo:warning=   56 | #  include <QtGui/qwindowdefs_win.h>
  cargo:warning=      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=compilation terminated.
  exit status: 0
  exit status: 0
  exit status: 1
  cargo:warning=ToolExecError: Command "x86_64-w64-mingw32-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate" "-I" "/usr/include/qt6/QtCore" "-I" "/usr/include/qt6/QtGui" "-I" "/usr/include/qt6/QtQml" "-I" "/usr/include/qt6" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out" "-Wall" "-Wextra" "-std=c++17" "-Wa,-mbig-obj" "-DCXX_QT_GUI_FEATURE" "-DCXX_QT_QML_FEATURE" "-o" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/9d38a231359fe1f4-qguiapplication.o" "-c" "src/gui/qguiapplication.cpp" with args x86_64-w64-mingw32-g++ did not execute successfully (status code exit status: 1).cargo:warning=In file included from /usr/include/qt6/QtGui/qpaintdevice.h:8,
  cargo:warning=                 from /usr/include/qt6/QtGui/qimage.h:10,
  cargo:warning=                 from /usr/include/qt6/QtGui/QImage:1,
  cargo:warning=                 from /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxx-qt-lib/qimage.h:11,
  cargo:warning=                 from src/gui/qimage.cpp:10:
  cargo:warning=/usr/include/qt6/QtGui/qwindowdefs.h:56:12: fatal error: QtGui/qwindowdefs_win.h: No such file or directory
  cargo:warning=   56 | #  include <QtGui/qwindowdefs_win.h>
  cargo:warning=      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=compilation terminated.

  exit status: 0
  exit status: 1
  cargo:warning=ToolExecError: Command "x86_64-w64-mingw32-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate" "-I" "/usr/include/qt6/QtCore" "-I" "/usr/include/qt6/QtGui" "-I" "/usr/include/qt6/QtQml" "-I" "/usr/include/qt6" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out" "-Wall" "-Wextra" "-std=c++17" "-Wa,-mbig-obj" "-DCXX_QT_GUI_FEATURE" "-DCXX_QT_QML_FEATURE" "-o" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/9d38a231359fe1f4-qimage.o" "-c" "src/gui/qimage.cpp" with args x86_64-w64-mingw32-g++ did not execute successfully (status code exit status: 1).
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0
  exit status: 0

  --- stderr

  CXX include path:
    /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include
    /home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate
    /usr/include/qt6/QtCore
    /usr/include/qt6/QtGui
    /usr/include/qt6/QtQml
    /usr/include/qt6

  error occurred: Command "x86_64-w64-mingw32-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/include" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/cxxbridge/crate" "-I" "/usr/include/qt6/QtCore" "-I" "/usr/include/qt6/QtGui" "-I" "/usr/include/qt6/QtQml" "-I" "/usr/include/qt6" "-I" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out" "-Wall" "-Wextra" "-std=c++17" "-Wa,-mbig-obj" "-DCXX_QT_GUI_FEATURE" "-DCXX_QT_QML_FEATURE" "-o" "/home/lem0nify/code/rust/qcounter/target/x86_64-pc-windows-gnu/release/build/cxx-qt-lib-17d7a846b076b304/out/9d38a231359fe1f4-qimage.o" "-c" "src/gui/qimage.cpp" with args x86_64-w64-mingw32-g++ did not execute successfully (status code exit status: 1).

Looks like it can't find QtGui/qwindowdefs_win.h header. Where can I get it from and how to provide path to it? I've also tried to build Qt cross-compiling toolchain with MXE hoping all needed files will be there but they aren't.

UPD: Okay, I've built it like this:

$ QMAKE=/path/to/my/mxe/usr/bin/x86_64-w64-mingw32.shared-qt6-qmake cargo build --release --target x86_64-pc-windows-gnu

Now the problem is that I have to provide Qt dlls with my executable for windows to run it on my Windows virtual machine. I have found out empirically that libraries needed are:

Qt6Core.dll
Qt6Gui.dll
Qt6Network.dll (why?)
Qt6OpenGL.dll (why?)
Qt6Qml.dll
Qt6QmlModels.dll
Qt6QmlWorkerScript.dll
Qt6Quick.dll
Qt6QuickControls2.dll
Qt6QuickControls2Basic.dll             |
Qt6QuickControls2BasicStyleImpl.dll    |
Qt6QuickControls2Fusion.dll            |
Qt6QuickControls2FusionStyleImpl.dll   | (why they all?)
Qt6QuickControls2Impl.dll              |
Qt6QuickControls2WindowsStyleImpl.dll  |
Qt6QuickTemplates2.dll                 |

and also platforms dir with qwindows.dll and qml dir with QML modules. But it wasn't obvious. It would be obvious if the list was at least like

Qt6Core.dll
Qt6Gui.dll
Qt6Qml.dll
Qt6Quick.dll
Qt6QuickControls2.dll
Qt6QuickControls2Impl.dll
Qt6QuickControls2WindowsStyleImpl.dll

for such simple application.

Is there way to get whole application distribution for windows in release directory automatically to just zip it and provide to users?

Yes, I know about windeployqt6.exe tool, but:

LeonMatthesKDAB commented 3 months ago

Hi @lem0nify, thank you for taking the time to write this issue.

The entire build process with CXX-Qt is rather complicated, so issues with cross-compiling are unfortunately not unexpected.

The solution to provide a custom path to QMAKE is indeed correct. I don't think there's another way we can detect where to look for those, just by using the target triple.

If I recall correctly, we detect the exact dlls to link to from the .prl files that come with your Qt installation. So that is not really in our control.

Cxx-Qt-lib has some features that you can use to specify which Qt modules it should link to (qt_gui, qt_qml, qt_quickcontrols). Depending on what you're doing, using those could reduce the number of linked dlls. However, for the counter example, you'll still need the QuickControls libraries, which are the ones you want to get rid of. We also link to Network by default because of some issues on macOS, which tends to static-link with some installations. But you can get rid of that in the cargo_without_cmake build script.

@ahayzen-kdab I guess we could investigate dumping out symlinks to the dlls we link to within the CXX_QT_EXPORT_DIR at least :thinking: That should at least allow you to find them more easily. Doing so in the target directory will be tough, as we would need to manually find that in our build scripts, which we've tried to avoid, as it's not really compatible with cargos build model.

lem0nify commented 3 months ago

However, for the counter example, you'll still need the QuickControls libraries, which are the ones you want to get rid of.

No, I didn't want to avoid linking with QuickControls. I mean, I don't understand why BasicStyle and FusionStyle are there if I'm building an app exclusively with the native Windows style. Isn't WindowsStyle enough? Or maybe I can somehow manually limit the build to the native style?

We also link to Network by default because of some issues on macOS, which tends to static-link with some installations.

Can't we use conditional compilation or something to make this only apply to macOS builds?

But you can get rid of that in the cargo_without_cmake build script.

I didn't quite understand what script you're talking about and how to use it. I don't use CMake, I have a regular Cargo project with only Cargo.toml and build.rs of the following contents:

[package]
name = "qcounter"
version = "0.1.0"
edition = "2021"
build = "build.rs"

[dependencies]
cxx = "1"
cxx-qt = "0.6"
cxx-qt-lib = "0.6"

[build-dependencies]
cxx-qt-build = "0.6"
use cxx_qt_build::{CxxQtBuilder, QmlModule};

fn main() {
    CxxQtBuilder::new()
        .qml_module(QmlModule {
            uri: "org.lem0nify.counter",
            rust_files: &["src/bridge.rs"],
            qml_files: &["qml/main.qml"],
            ..Default::default()
        })
        .build();
}
LeonMatthesKDAB commented 3 months ago

CXX-Qt cannot tell which style you're using, so it needs to link to all of them. I don't know if there are some Qt tools that can determine this. We would have to check whether Qt can determine this in a normal CMake build and see how that works. Though I doubt that Qt can tell either.

Can't we use conditional compilation or something to make this only apply to macOS builds?

Sure, you can use #[cfg(macos)] to disable the call to .qt_module("Network"). I meant the example here: https://github.com/KDAB/cxx-qt/blob/1d1af2f29c5160e484c1f94ab8ab5e92b2dda5a1/examples/cargo_without_cmake/build.rs#L16 We don't use conditional compilation in our examples as those are supposed to be as simple as possible and linking to "Network" usually doesn't hurt.

However, you don't actually have the call to "Network" in your build script, so it's indeed strange that it shows up as a dependency :thinking: It may be listed as a dependency of another Qt module somewhere. We extract the list of DLLs to link from the prl files that come with each Qt installation. So maybe that's listed there somewhere...

lem0nify commented 3 months ago

We extract the list of DLLs to link from the prl files that come with each Qt installation. So maybe that's listed there somewhere...

Here are all .prl files containing "Qt6Network" string in my Qt installation:

lem0nify@arch ~/src/mxe/usr/x86_64-w64-mingw32.shared % find . -name '*.prl' -exec awk '/Qt6Network/{print gensub(/.*\//,"",1,FILENAME); nextfile}' {} +
Qt6Network.prl
Qt6QmlDebug.prl
Qt6QmlDom.prl
Qt6QuickTestUtils.prl
Qt6QuickControlsTestUtils.prl

Contents of Qt6QmlDom.prl file:

QMAKE_PRL_TARGET = libQt6QmlDom.a
QMAKE_PRL_CONFIG = static
QMAKE_PRL_VERSION = 6.7.2
QMAKE_PRL_LIBS = $$[QT_INSTALL_LIBS]/libQt6QmlBuiltins.a $$[QT_INSTALL_LIBS]/libQt6Qml.a $$[QT_INSTALL_LIBS]/libQt6QmlCompiler.a $$[QT_INSTALL_LIBS]/libQt6Qml.a $$[QT_INSTALL_LIBS]/libQt6QmlBuiltins.a $$[QT_INSTALL_LIBS]/libQt6Network.a $$[QT_INSTALL_LIBS]/libQt6Core.a -lmpr -luserenv -lws2_32 -lshell32
QMAKE_PRL_LIBS_FOR_CMAKE = $$[QT_INSTALL_LIBS]/libQt6QmlBuiltins.a;$$[QT_INSTALL_LIBS]/libQt6Qml.a;$$[QT_INSTALL_LIBS]/libQt6QmlCompiler.a;$$[QT_INSTALL_LIBS]/libQt6Qml.a;$$[QT_INSTALL_LIBS]/libQt6QmlBuiltins.a;$$[QT_INSTALL_LIBS]/libQt6Network.a;$$[QT_INSTALL_LIBS]/libQt6Core.a;-lmpr;-luserenv;-lws2_32;-lshell32

Does it mean that my application is linked statically against it?

By the way, it's interesting that MXE does some static linkages with x86_64-w64-mingw32.shared target. It will break LGPL oligations if I sell my application. 🥲

LeonMatthesKDAB commented 3 months ago

If I understand the code in qt-build-utils correctly (I haven't written it and am not too familiar with it), it will detect all libraries that are listed under QMAKE_PRL_LIBS and instruct cargo to link to those libraries.

For this it strips away the lib prefix and the file extension .a. So cargo will be instructed to link to Qt6Network. Whether it does so statically or dynamically seems to be up to the linker at that point, as we're not passing in the KIND to link :thinking:

If you want to investigate this yourself, take a look at crates/qt-build-utils/src/lib.rs and the cargo_link_libraries function. This is what sets up the way we link to Qt with Cargo.

lem0nify commented 3 months ago

I investigated this and found out that CXX-QT actually links my application only to Qt6Core.dll, Qt6Gui.dll and Qt6Qml.dll, since none of the .prl files of these libraries for Windows contain reference to Qt6Network. At first I thought that CXX-QT for some reason parses .prl files from my host system (libQt6Qml.prl there indeed contains it), despite the fact that I specify the path to cross-qmake, but no. It turns out that Qt6Qml.dll itself is linked to Qt6Network.dll, unfortunately. 😢 I discovered this when I was browsing the import sections of the binaries with CFF Explorer in a Windows VM.

Yeah, seems it will be hard for you guys to implement the creation of a bundle with all the required libraries when cross-compiling.

But you could at least bundle the qml directory with the required QML plugins (or whatever is required, I'm not very familiar with Qt terminology). Unlike the error messages about missing libraries, the application doesn't properly report missing required qml directory contents, so I had to just copy the whole thing into the application folder from the Qt installation.

LeonMatthesKDAB commented 3 months ago

What qml files are you referring to exactly? If you declare a qml_module on the CxxQtBuilder, the files specified there should be compiled into your application so shouldn't need to be distributed separately?

ahayzen-kdab commented 3 months ago

Yes, Qt libraries may link to other Qt libraries or system libs that are required to be distributed with your application, this is a common problem even without Rust for general Qt/C++ and there are tools like windeployqt6 trying to help.

For static vs dynamic linking I would note that static linking by itself is not necessarily a violation of LGPL, it means you need to be able to provide object code for your application though, see https://www.gnu.org/licenses/gpl-faq.en.html#LGPLStaticVsDynamic

Yes, cross compiling in general is tricky when you involve C/C++ and not inside only Rust libraries :-/

For QML modules, if you are using https://docs.rs/cxx-qt-build/latest/cxx_qt_build/struct.CxxQtBuilder.html#method.qml_module then the QML resources and modules are statically linked into the Rust library (and then into your executable) and will be found by qrc (Qt resources) so there should be no need for distributing a qml folder as they'll be embedded inside the binary.

lem0nify commented 3 months ago

What qml files are you referring to exactly?

It's easier to show than to explain in words.

https://youtu.be/fMQxwT7ZhoQ

Here is folder with *plugin.dll files which are loaded dynamically (not listed in import sections of binaries) and application doesn't show any error message if they are missing. It just doesn't launch, as you can see. There are also *.qmltypes and qmldir files there but I'm not sure they are needed or not.

If I remove all subdirectories from there except QtQml and QtQuck application launches successfully, so for counter example only these two components are needed. How should I figure out that exactly they are needed without trial and error method?

there are tools like windeployqt6 trying to help

windeployqt6 is not a solution. Maybe it is for C++ Qt application but not for CXX-QT rust application, cross-compiled from linux. Here is an environment created with windeployqt6:

image

As you can see, it is redundant. It is both redundant and still insufficient to run the application (Qt6QuickControls2*.dll files are missing and qml directory here is empty).

ahayzen-kdab commented 3 months ago

Ah that qml directory, those come from the Qt toolchain/sdk/runtime (whatever you want to call it) and need to be bundled with your application. You may need to use a combination of things like --qmldir --qmlimport --plugindir etc to inform windeployqt to scan for QML dependencies that are used.

But maybe it gets slightly confused as I don't think anyone has tried this yet, so might need some investigation how to set it up correctly.

windeployqt takes an .exe file or a directory that contains an .exe file as an argument, and scans the executable for dependencies. If a directory is passed with the --qmldir argument, windeployqt uses the qmlimportscanner tool to scan QML files inside the directory for QML import dependencies. Identified dependencies are then copied to the executable's directory.

https://doc.qt.io/qt-6/windows-deployment.html#the-windows-deployment-tool

LeonMatthesKDAB commented 3 months ago

Hm, right, that's data that's not really provided by your application, but rather by the Qt installation, as @ahayzen-kdab noted.

The point here that we will need to know is whether this is an issue with CXX-Qt or with cross-compilation from Linux. If it's a general problem in cross-compiling with Qt, we probably won't be able to help.

Could you test your setup with a simple CMake-based example to check that the issue doesn't exist there and is indeed specific to CXX-Qt?

lem0nify commented 3 months ago

Could you test your setup with a simple CMake-based example to check that the issue doesn't exist there and is indeed specific to CXX-Qt?

Yeah, windeployqt6.exe from Qt for Windows toolchain works in the same way for C++ QtQuick helloworld cross-compiled for linux, so it is not CXX-QT issue.

I'm not saying this is a CXX-QT issue at all. I'm not even saying you SHOULD find a solution to this problem on the CXX-QT side. But you COULD try to find it once the main tasks are done, because it would still be a good improvement, wouldn't it?

LeonMatthesKDAB commented 3 months ago

Even though it would be an improvement, we would also have to maintain such a solution. If not even Qt has the time to solve this issue, we probably won't either.

So for now I'll close this issue and we may revisit it after 1.0, though I doubt we will ever find time to go beyond what Qt can do for cross-compiling. Currently we only aim to get to the same level of support that Qt itself has, and not expand much beyond that. This is an open-source free-to-use project after all.

lem0nify commented 3 months ago

@LeonMatthesKDAB Well. Excuse me for offtopic, is it planned to add bindings to other Qt modules? I'm particularly interested in vanilla QtWidgets.

LeonMatthesKDAB commented 3 months ago

Not with the same level of support that we want to provide for QML.

The Widgets API is huge and wrapping it completely is a big undertaking, so we won't be able to do that on our own. Most types are rather easy to wrap with CXX though, so depending on your task you may be able to do a lot of that yourself. We hope to support wrapping more types through our new cxx-qt-lib-extras crate. The goal for this crate is to have a place where the community can put wrappers for Qt types, even if they're not completetly wrapped and maybe not up to the quality of cxx-qt-lib. Contributions there will have a much lower bar of entry than e.g. cxx-qt-lib and we won't provide many guarantees about it. So hopefully we can have many people contribute their bindings to QtWidgets types there, which may fill the gap.