KDAB / cxx-qt

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

Build a single-file executable #693

Open FynnFbc opened 1 year ago

FynnFbc commented 1 year ago

How to package the dll required by a program into a single executable file Programs can be copied to other machines without qt installed Please provide the following solution thank you

ahayzen-kdab commented 1 year ago

You would need to build to a statically linked binary.

Usually this means you either have a Qt commercial license or understand the LGPLv3 requirements and have a Qt install with static libraries available to link to.

Then if using CMake you need ensure that it links statically and not dynamically. But i believe that macOS uses static linking by default so there might not be much modification required there.