This guide provides detailed instructions for building MalDestruct from source.
-
Operating System
- Windows 10/11 (64-bit)
-
Compiler
- Microsoft Visual Studio 2019 or later (recommended)
- OR MinGW-w64 GCC 9.0+
-
CMake
- Version 3.20 or later
- Download from: https://cmake.org/download/
-
Qt Framework
- Qt 6.2 or later
- Download from: https://www.qt.io/download-qt-installer
- Required components:
- Qt Core
- Qt Widgets
- Qt6 Core5Compat (optional)
-
Windows SDK
- Windows 10 SDK (10.0.19041.0 or later)
- Included with Visual Studio
- Git for version control
- Ninja build system (faster than MSBuild)
# Open x64 Native Tools Command Prompt for VS 2022
# Navigate to project directory
cd /d C:\Path\To\MalDestruct
# Create build directory
mkdir build
cd build
# Configure
cmake .. -G "Visual Studio 17 2022" -A x64 ^
-DCMAKE_PREFIX_PATH="C:/Qt/6.5.0/msvc2019_64"
# Build
cmake --build . --config Release --parallel 8
# The executables will be in build/bin/# Open MinGW terminal
# Navigate to project directory
cd /d C:/Path/To/MalDestruct
# Create build directory
mkdir build
cd build
# Configure
cmake .. -G "MinGW Makefiles" ^
-DCMAKE_PREFIX_PATH="C:/Qt/6.5.0/mingw_64" ^
-DCMAKE_BUILD_TYPE=Release
# Build
cmake --build . --parallel 8# Open x64 Native Tools Command Prompt for VS 2022
cd /d C:\Path\To\MalDestruct
mkdir build
cd build
# Configure
cmake .. -G Ninja ^
-DCMAKE_PREFIX_PATH="C:/Qt/6.5.0/msvc2019_64" ^
-DCMAKE_BUILD_TYPE=Release
# Build
ninjacmake --build . --config Releasecmake --build . --config Release --target MalDestruct_Consolecmake --build . --config Release --target MalDestruct_GUIcmake --install . --prefix "C:/Program Files/MalDestruct"cpack -C ReleaseIf CMake can't find Qt automatically:
cmake .. -DCMAKE_PREFIX_PATH="C:/Qt/6.5.0/msvc2019_64"# Release (optimized, no debug info)
cmake .. -DCMAKE_BUILD_TYPE=Release
# Debug (with debug symbols)
cmake .. -DCMAKE_BUILD_TYPE=Debug
# RelWithDebInfo (optimized + debug info)
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo# Use 8 cores
cmake --build . --parallel 8
# Use all available cores
cmake --build . --parallelError: Could not find Qt6
Solution:
set Qt6_DIR=C:\Qt\6.5.0\msvc2019_64\lib\cmake\Qt6
cmake ..Error: Windows SDK not found
Solution:
- Install Windows SDK via Visual Studio Installer
- Or download from: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/
Error: Cannot find dbghelp.lib
Solution:
- Ensure Windows SDK is installed
- Add to CMake:
-DCMAKE_LIBRARY_PATH="C:/Program Files (x86)/Windows Kits/10/Lib/10.0.xxxxx.0/um/x64"
Solution:
- Ensure source files are saved as UTF-8
- Add to CMakeLists.txt:
add_compile_options(/utf-8)
Solution:
# Copy Qt DLLs to bin directory
windeployqt build/bin/MalDestruct_GUI.exe
# Or add Qt bin to PATH
set PATH=%PATH%;C:\Qt\6.5.0\msvc2019_64\binFor development with faster compile times:
mkdir build_dev
cd build_dev
cmake .. -G Ninja ^
-DCMAKE_BUILD_TYPE=Debug ^
-DCMAKE_PREFIX_PATH="C:/Qt/6.5.0/msvc2019_64" ^
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ninjaFor distribution without DLL dependencies:
cmake .. -G Ninja ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH="C:/Qt/6.5.0/msvc2019_64_static" ^
-DBUILD_SHARED_LIBS=OFF
ninjaMalDestruct can be cross-compiled for different Windows architectures:
cmake .. -G "Visual Studio 17 2022" -A Win32cmake .. -G "Visual Studio 17 2022" -A ARM64After building, verify the executables:
cd build/bin
# Console version
MalDestruct_Console.exe --version
# GUI version
MalDestruct_GUI.exeAdd to CMakeLists.txt:
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)# 1. Build with instrumentation
cmake .. -DCMAKE_CXX_FLAGS="/GL"
cmake --build .
# 2. Run to generate profile data
bin/MalDestruct_Console.exe
# 3. Rebuild with optimization
cmake .. -DCMAKE_CXX_FLAGS="/GL /LTCG"
cmake --build .# Remove build directory
rm -rf build
# Or use CMake
cmake --build . --target cleanAfter successful build:
- Read README.md for usage instructions
- Configure
maldestruct.conf - Run with administrator privileges
- Check logs in
C:\ProgramData\MalDestruct\Logs\
If you encounter build issues:
- Check this guide thoroughly
- Search GitHub Issues
- Create a new issue with:
- CMake version
- Qt version
- Compiler version
- Full error output
- CMakeCache.txt (if applicable)
Happy Building! 🚀