Common Build Errors¶
- ✅ VS2017 path issues: solutions for non-ASCII paths and MAX_PATH limitations
- ✅ MOC build glitches: simple fix for first-build batch MOC failures
- ✅ QWindowKit dependency missing: configuration troubleshooting for third-party library
| Error Symptom | Cause | Solution |
|---|---|---|
error D8050: cannot execute c1xx.dll |
Build path contains non-ASCII characters or exceeds 260 chars | Set English build path, enable Win32 long paths |
| MOC-related compile errors | First-build batch MOC operations glitch | Keep build directory, rebuild 1-2 times |
Could not find QWindowKit |
QWindowKit source missing or a wrong package path | Initialize the submodule / provide the source, or set -DQWindowKit_DIR |
QWKWidgets.dll was not found at runtime |
QWindowKit DLLs from an installed package are not next to the example (Windows has no RPATH) | Re-run the CMake configure step; examples copy the QWK runtime automatically |
VS 2017 compiler error
error D8050: cannot execute xxx/c1xx.dll – failed to insert command-line into debug record
If VS is installed correctly but this error still appears, two situations are usually responsible:
- Non-ASCII characters in the build path
Early VS versions (e.g. VS 2017) place the build tree under the user's temp directory.
When the user name contains Chinese (or other non-ASCII) characters, the compiler fails.
Fix: override the build root inCMakeSettings.json(or VS settings):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
-
Maximum path length limitation (260 chars)
Windows still enforces the legacy MAX_PATH limit by default.
Enable long-path support via Group Policy Editor:1 2 3 4 5 6 7
Press Win + R, type gpedit.msc. Navigate to: Computer Configuration > Administrative Templates > System > Filesystem Enable "Enable Win32 long paths". Reboot the system.If the problem persists, simply move the project to a shorter location (e.g.
D:\src) to reduce path length.
MOC errors during build
When the output shows moc-related failures, just run the build again.
This usually happens on the very first build when many files are MOC-ed simultaneously.
Keep the existing build folder and re-invoke CMake/ninja/make; the issue disappears on the second or third attempt.
QWindowKit not found
If you enabled SARIBBON_USE_FRAMELESS_LIB=ON but get Could not find a package configuration file provided by "QWindowKit", CMake could not obtain QWindowKit from any of these sources:
- Bundled source (default, recommended) —
src/SARibbonBar/3rdparty/qwindowkitis built as a subdirectory, no separate install needed. When the source is missing, CMake runsgit submodule update --init --recursiveautomatically; source ZIP downloads must provide the source manually. - A package specified by
-DQWindowKit_DIR— takes priority when QWindowKit is already installed. - Local install directory / system path — a previously built and installed QWindowKit.
Common causes: the submodule or its nested dependencies are missing and auto-initialization failed (network/proxy), the source tree was moved (use -DSARIBBON_QWK_SOURCE_DIR=...), CMake is older than 3.19 with no installed package, or QWindowKit_DIR points to the wrong directory.
To point at a prebuilt package manually:
1 | |
If you don't need QWindowKit, set SARIBBON_USE_FRAMELESS_LIB to OFF.
Missing QWKWidgets.dll when running an example
The code execution cannot proceed because QWKWidgets.dll was not found.
With SARIBBON_USE_FRAMELESS_LIB=ON, SARibbonBar.dll depends on the QWindowKit shared libraries. Windows has no RPATH: a process only looks for dependencies next to the executable and on PATH, while the QWindowKit DLLs may live elsewhere:
- When QWindowKit is built from the bundled source, its output directory is already redirected to the build tree
bin, so this rarely happens. - When QWindowKit comes from
find_package(an installed package), its DLLs stay in that installation (e.g.<QtKit>/bin,vcpkg_installed/x64-windows/bin).
Examples and tests now copy the QWindowKit runtime libraries next to their own output directory as a post-build step on Windows (implemented in cmake/SARibbonQwkDeploy.cmake), so no manual copying is needed. If the error persists:
- Make sure the fixed CMake scripts are used and re-run the CMake configure step (recompiling alone does not refresh post-build commands).
- When running your own application, call the same helper on your target:
1 | |