Problems compiling and building the project
-
Problems compiling and building the project
I cloned the project from here: https://github.com/Schildkroet/CANgaroo. Compiled using QT Creator, assembled using the windeployqt utility. Since the project's GitHub page includes a Windows release, I can compare my build with the one on the project page. I found the following significant differences:- My exe file is 70 times larger.
- When building, I get warnings like
"Warning: Cannot find any version of the dxcompiler.dll and dxil.dll."
Warning: Cannot find Visual Studio installation directory, VCINSTALLDIR is not set. All of these files are present on the computer. The path to what is missing? - My number of DLLs is significantly smaller. I only have DLLs like QT6... and no DLLs like libbrotlicommon.dll, libdouble-conversion.dll, etc. 4. When I run my executable, I get the error "The procedure entry point _ZN10QchartView13setRubberBandERK6QFlagsINS_10RubberBandEE could not be found in the DLL."
Where to start to solve problems?
-
K kservice referenced this topic
-
Hi,
You should check their Windows build workflows. You'll see all the steps they take to create their release.
-
Thank you, that's a very valuable tip! But my knowledge base is too weak to fully utilize this.
• Since there are workflows, does that mean GitHub Actions were used?
• I saw that MinGW runtime DLLs are imported. This explains the difference in the number of libraries.
But how do I use this when manually using windeployqt?
• And most importantly, I couldn't figure out what the author used for compilation: MSYS2 or MinGW. It was the compilation method that determined the huge difference in EXE size, right? -
- yes
- you can write a script that calls windeployqt and then copy the extra dependencies
- msys2 is a collection of tool. MinGW was used to build the release
You have likely built in debug mode.
-
- yes
- you can write a script that calls windeployqt and then copy the extra dependencies
- msys2 is a collection of tool. MinGW was used to build the release
You have likely built in debug mode.
@SGaist said in Problems compiling and building the project:
2. you can write a script that calls windeployqt and then copy the extra dependencies
3. msys2 is a collection of tool. MinGW was used to build the release
You have likely built in debug mode.- Everything is more or less clear with the libraries. Could you elaborate a bit on how I can do this in debug mode?
Will I need Docker? - If both the author and I used MinGW, why is there such a big difference in the .exe file size?
-
- no you don't just read the content of the workflows. These are basically turned into shell scripts (more or less). You can copy the logic.
- Debug VS release builds, possibly some optimisation flags.
-
Thank you for the excellent tip regarding "Debug vs. Release builds, possibly some optimization flags." This allowed me to pinpoint the reason for the discrepancy in the EXE file size. The application now launches—though only after upgrading to Qt 6.10.2 (I was previously using Qt 6.7.3).
One question remains for future reference: which version of Qt should one use in general if the author hasn't provided specific instructions?
-
I also forgot to ask one more thing:
- What tools should I use to modify the author's application (for example, to make changes to the menu, alter button labels, etc.)? As I understand it, Qt Design Studio won't be of any help here?
- Why am I unable to start debugging in Visual Studio? The "RUN" button is inactive. After all, it appears to be written in C++.
-
- From a quick look, they used Designer. Qt Creator already integrates it so need for other tools.
- I don't know, I am not on your machine. Silly question but: did you install the C++ stuff for Visual Studio ? They are not part of the default installation if memory serves well.
Any particular reason to want to use Visual Studio's compiler over MinGW ?
-
- The C++ components for Visual Studio are installed.
- There is no specific reason. I am more familiar with VS2022 than with Qt Creator, so I wanted to give it a try. However, as I understand it, it uses the MSVC compiler. And when using that compiler, I encounter a multitude of errors (moreover, fixing one error seems to trigger others). Is it possible that the code is optimized for a specific compiler (given that MinGW issues only 5–6 warnings, whereas MSVC reports 7 warnings and 15 errors)?
-
Are these Qt specific errors or something else ?
-
How did you resolve it ?
-
windeployqtonly bundles Qt’s own libraries.For MSYS2: Have an AI write a Python script with the following logic:
- Recursively scan the target folder generated by
windeployqt—including all subdirectories—to enumerate all executable files and DLLs. This ensures dependencies for plugins likeqsqlpsqlare also fully captured. - Run
lddon each file, extract all library paths starting withc:/msys64or/c/msys64, and copy those libraries to the deployment folder. - Repeat step 1 in a loop until
lddno longer returns any library paths beginning withc:/msys64.
For MSVC (VC): Match the corresponding compiler version, and include the compatible
vcredist_x64redistributable when delivering the package to end users. - Recursively scan the target folder generated by