Skip to content

Latest commit

 

History

History
152 lines (111 loc) · 3.65 KB

File metadata and controls

152 lines (111 loc) · 3.65 KB

Running MalDestruct GUI - DLL Issues Fix

The Problem

When you try to run MalDestruct_GUI.exe, you get:

The code execution cannot proceed because Qt6Widgetsd.dll was not found.

This happens because the Qt runtime DLLs are not in the same directory as the executable or in your system PATH.

Quick Fix: Copy Qt DLLs

Option 1: Use the Deployment Script (Easiest)

cd C:\Users\cysec\OneDrive\Desktop\MalDestruct\MalDestruct
deploy_gui.bat

Or:

copy_qt_dlls.bat

This script will:

  • Find your Qt installation
  • Copy required Qt DLLs to build\bin\
  • Copy the platform plugin
  • Copy MSVC runtime DLLs

Option 2: Add Qt to PATH (Temporary)

set PATH=%PATH%;C:\Qt\6.9.3\msvc2022_64\bin
build\bin\MalDestruct_GUI.exe

Option 3: Manual Copy

Copy these files from C:\Qt\6.9.3\msvc2022_64\bin\ to build\bin\:

  • Qt6Cored.dll (or Qt6Core.dll for Release)
  • Qt6Widgetsd.dll (or Qt6Widgets.dll for Release)
  • Qt6Guid.dll (or Qt6Gui.dll for Release)

Also copy the platform plugin:

  • From: C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindowsd.dll
  • To: build\bin\platforms\qwindowsd.dll
  • Create the platforms folder if it doesn't exist

Using Qt Deployment Tool (Recommended for Distribution)

Qt provides a tool called windeployqt that automatically copies all required DLLs:

cd C:\Qt\6.9.3\msvc2022_64\bin
windeployqt.exe C:\Users\cysec\OneDrive\Desktop\MalDestruct\MalDestruct\build\bin\MalDestruct_GUI.exe

This will:

  • Copy all required Qt DLLs
  • Copy platform plugins
  • Copy other dependencies
  • Set up the correct directory structure

Permanent Solution: Add Qt to System PATH

For Current Session Only:

set PATH=%PATH%;C:\Qt\6.9.3\msvc2022_64\bin

For All Sessions (System-wide):

  1. Press Win + XSystem
  2. Click Advanced system settings
  3. Click Environment Variables
  4. Under System variables, find Path
  5. Click Edit
  6. Click New
  7. Add: C:\Qt\6.9.3\msvc2022_64\bin
  8. Click OK on all dialogs
  9. Restart any open command prompts/terminals

Verify It Works

After copying DLLs or adding to PATH:

  1. Navigate to build\bin\
  2. Double-click MalDestruct_GUI.exe
  3. It should launch without errors!

Troubleshooting

Still Getting DLL Errors?

  1. Check if DLLs were copied:

    dir build\bin\*.dll
  2. Verify Qt path is correct:

    dir C:\Qt\6.9.3\msvc2022_64\bin\Qt6*.dll
  3. Check for Debug vs Release mismatch:

    • Debug build needs *d.dll files (Qt6Cored.dll, Qt6Widgetsd.dll)
    • Release build needs regular .dll files (Qt6Core.dll, Qt6Widgets.dll)
  4. Use Dependency Walker:

    • Download Dependency Walker
    • Open MalDestruct_GUI.exe
    • See which DLLs are missing

Missing Platform Plugin

If you get "This application failed to start because no Qt platform plugin could be initialized":

  1. Create build\bin\platforms\ folder
  2. Copy qwindowsd.dll (Debug) or qwindows.dll (Release) from: C:\Qt\6.9.3\msvc2022_64\plugins\platforms\ To: build\bin\platforms\

For Distribution

When distributing your application, you have two options:

Option 1: Bundle DLLs (Recommended)

  • Copy all required DLLs to the same folder as the executable
  • Users can run it without installing Qt

Option 2: Use Qt Installer Framework

  • Create an installer that includes Qt runtime
  • More complex but professional

Quick Reference

Copy DLLs script:

copy_qt_dlls.bat

Deploy with windeployqt:

C:\Qt\6.9.3\msvc2022_64\bin\windeployqt.exe build\bin\MalDestruct_GUI.exe

Add to PATH (temporary):

set PATH=%PATH%;C:\Qt\6.9.3\msvc2022_64\bin