Skip to content

Latest commit

 

History

History
114 lines (86 loc) · 2.89 KB

File metadata and controls

114 lines (86 loc) · 2.89 KB

Commands to Build GUI

Quick Answer

Command to build GUI:

cmake --build build --target MalDestruct_GUI --config Release

Or using the batch script:

rebuild_gui.bat

Why GUI Target Doesn't Appear in Visual Studio

The GUI target (MalDestruct_GUI) doesn't appear in Visual Studio's build menu because:

  1. CMake configuration failed - When Qt isn't found, CMake fails at line 13 (find_package(Qt6 REQUIRED ...))
  2. Targets aren't created - If CMake configuration fails, no targets are created, so Visual Studio only shows what was successfully configured
  3. CMake cache issue - Visual Studio might be using an old cache where Qt wasn't found

Solution: Fix CMake Configuration

Step 1: Update CMakeSettings.json

Make sure CMAKE_PREFIX_PATH points to your MSVC Qt installation:

{
  "name": "CMAKE_PREFIX_PATH",
  "value": "C:/Qt/6.9.3/msvc2022_64",
  "type": "PATH"
}

Step 2: Force CMake Reconfiguration

Option A: Delete CMake Cache

cd C:\Users\cysec\OneDrive\Desktop\MalDestruct\MalDestruct
rmdir /s /q build
mkdir build

Then reopen Visual Studio - it will reconfigure automatically.

Option B: Reconfigure in Visual Studio

  1. Go to Project → CMake Settings for MalDestruct
  2. Click Save (even without changes)
  3. This triggers CMake reconfiguration
  4. Check View → Output → Show output from: CMake for errors

Step 3: Verify Both Targets Appear

After successful configuration:

  • In Solution Explorer, expand CMake Targets
  • You should see:
    • MalDestruct_Console
    • MalDestruct_GUI

Building GUI - All Methods

Method 1: Visual Studio GUI

  1. Right-click MalDestruct_GUI in Solution Explorer
  2. Select Build

Method 2: Visual Studio Command (Terminal)

cd build
cmake --build . --target MalDestruct_GUI --config Release

Method 3: Batch Script

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

Method 4: Developer Command Prompt

cd C:\Users\cysec\OneDrive\Desktop\MalDestruct\MalDestruct\build
cmake --build . --target MalDestruct_GUI --config Release

Debugging CMake Configuration

If GUI target still doesn't appear, check CMake output:

  1. View → Output
  2. Show output from: CMake
  3. Look for:
    • -- Configuring done (success)
    • CMake Error (failure)
    • Could not find Qt6 (Qt not found)

Expected CMake Output (Success)

-- The CXX compiler identification is MSVC 19.44.35222.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler
-- Check for working CXX compiler - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Qt6: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: C:/.../build

If you see -- Found Qt6: TRUE, both targets should appear!