- Improved build.bat with auto-detection of Qt6 installation - Checks common Qt6 paths automatically - Provides helpful error messages with paths to check - Works with Qt6.4 through Qt6.8 - Added check-setup.bat verification script - Verifies CMake, Visual Studio 2022, and Qt6 installation - Reports found/missing prerequisites - Quick setup validation before building - Added comprehensive SETUP.md documentation - Quick 3-step setup guide - Detailed manual setup instructions - Qt6 download and installation steps - Troubleshooting for common issues - Manual CMake command reference - Environment variable setup - Updated README.md - Links to SETUP.md for first-time users - Quick build instructions - Clear prerequisites with download links - Better organized for both quick and manual builds Fixes CMake Qt6 detection errors by: 1. Auto-searching common Qt6 installation paths 2. Providing fallback manual build instructions 3. Detecting missing prerequisites with helpful links Co-authored-by: Cursor <cursoragent@cursor.com>
4.6 KiB
4.6 KiB
Commonwealth Online Qt GUI - Setup Instructions
Quick Setup (3 Steps)
Step 1: Install Qt6
-
Download Qt6 from: https://www.qt.io/download-open-source
-
Run the installer and select:
- ✓ Qt 6.8 (or latest 6.x)
- ✓ MSVC 2022 64-bit component
- Install to default location:
C:\Qt\6.8.0\
-
After installation, verify the path exists:
C:\Qt\6.8.0\msvc2022_64\lib\cmake\Qt6
Step 2: Verify Prerequisites
Run the setup checker:
cd host-gui
check-setup.bat
This verifies:
- ✓ CMake 3.20+
- ✓ Visual Studio 2022
- ✓ Qt6 installation
Step 3: Build
cd host-gui
build.bat
The script will:
- Auto-detect Qt6 location
- Configure CMake
- Build Release executable
- Output:
host-gui/build/bin/Release/CommonwealthOnlineHost.exe
Detailed Setup (If Quick Setup Fails)
Manual Qt6 Installation
-
Download Qt Online Installer
- Go to https://www.qt.io/download-open-source
- Download "Qt Online Installer for Windows"
-
Run Installer
- Create Qt account (free)
- Select "Custom installation"
- Under "Qt 6.8.0" (or latest):
- ✓ MSVC 2022 64-bit
- ✓ Qt 5compat (optional)
- Under "Developer and Designer Tools":
- ✓ CMake (if not already installed)
- Click "Install"
-
Verify Installation
- Check that this folder exists:
C:\Qt\6.8.0\msvc2022_64\ - Should contain:
lib\cmake\Qt6\ bin\ include\ plugins\
- Check that this folder exists:
Manual CMake Installation
If CMake isn't found:
- Download from: https://cmake.org/download/
- Run installer
- When prompted, select "Add CMake to PATH"
- Restart your terminal/command prompt
Manual Visual Studio 2022 Installation
If Visual Studio 2022 isn't found:
- Download from: https://visualstudio.microsoft.com/downloads/
- Run installer
- Select "Desktop development with C++"
- Install
Building Manually (If Scripts Fail)
Command Line Build
cd host-gui
mkdir build
cd build
# Configure (replace path with your Qt6 location)
cmake .. -G "Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="C:\Qt\6.8.0\msvc2022_64"
# Build Release
cmake --build . --config Release
Visual Studio IDE Build
- Open Visual Studio 2022
- File → Open → Folder
- Select
host-guifolder - Wait for CMake configuration
- Build → Build All
- Executable at:
host-gui/build/bin/Release/CommonwealthOnlineHost.exe
Troubleshooting
"Qt6 not found"
Solution 1: Edit build.bat and update Qt6 search paths
- Find the line with
PATHS_TO_CHECK - Add your Qt6 installation path
Solution 2: Use manual CMake with explicit path
cmake .. -G "Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="C:\path\to\your\Qt6"
"Visual Studio not found"
Make sure Visual Studio 2022 is installed with C++ development tools:
- Open Visual Studio Installer
- Modify your installation
- Select "Desktop development with C++"
- Click "Modify"
"CMake not found"
Add CMake to PATH:
- Install CMake from cmake.org
- Select "Add CMake to PATH"
- Restart terminal
"Build fails with link errors"
Ensure you're using the matching MSVC version:
- Qt6 installed for MSVC 2022 64-bit
- Building with "Visual Studio 17 2022" generator
- Using Release build configuration
Running the Application
After successful build:
cd host-gui
start build\bin\Release\CommonwealthOnlineHost.exe
Or double-click:
host-gui\build\bin\Release\CommonwealthOnlineHost.exe
Environment Setup (Advanced)
If you want to set up your environment permanently:
Windows Environment Variables
- Press
Win + X, select "System" - Click "Advanced system settings"
- Click "Environment Variables"
- Add or update:
CMAKE_PREFIX_PATH = C:\Qt\6.8.0\msvc2022_64 - Restart terminal
Then you can just run:
cd host-gui
mkdir build
cd build
cmake ..
cmake --build . --config Release
Next Steps After Build
Once you have a successful build:
-
Test the Application
- Launch
CommonwealthOnlineHost.exe - Click "Start Server"
- Verify logs appear
- Launch
-
Connect Clients
- Run fake_client from server directory
- Should see client in GUI table
-
Customize
- Edit colors/styling in
MainWindow.cpp - Add admin buttons in
MainWindow.h/cpp - Extend ServerProcess for more features
- Edit colors/styling in
Support
If you encounter issues:
- Run
check-setup.batto verify prerequisites - Review output and error messages carefully
- Check this troubleshooting guide
- Try manual CMake command with explicit paths