Prerequisites
-
Install Visual Studio 2022 with Desktop development for C++ and MFC (Community edition is free - https://visualstudio.microsoft.com/vs/community/)
-
Install Qt 5.15.2 or 6.7+ (including optional Qt Charts WebEngine for 5.15.2 and Qt Charts, StateMachine, Qt5Compat, Location, Multimedia, Positioning, SerialPort, ShaderTools, Speech, WebSockets and WebEngine for 6.7+ - WebEngine is under Extensions, not Additional Libraries for 6.8+) for MSVC 2019 64-bit or MSVC 2022 64-bit for 6.8 (https://www.qt.io/download-open-source)
-
Install Boost (https://www.boost.org/users/download/)
-
Install ninja (https://ninja-build.org/) - May also be installed with Qt
-
Install cmake (https://cmake.org/download/) - May also be installed with Visual Studio or Qt
-
Install git (https://git-scm.com/download/win)
-
Install NSIS (https://nsis.sourceforge.io/Download)
-
Make sure git, cmake, nsis and ninja are in your PATH environment variable.
-
Optionally install CUDA Toolkit 12.6 https://developer.nvidia.com/cuda-downloads and check CUDA_PATH points to the install
Compile and Build (cmd line)
Run Visual Studio shell: Start > Visual Studio 2022 > x64 Native Tools Command Prompt for VS 2022
Then:
cd %userprofile% (or wherever you want to build that has 10GB free space)
git clone https://github.com/f4exb/sdrangel.git
cd sdrangel
git submodule update --init --recursive
mkdir build
cd build
cmake -Wno-dev -G Ninja -DCMAKE_BUILD_TYPE=Release -DRX_SAMPLE_24BIT=ON -DCMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64;C:\boost_1_81_1 ..
ninja
ninja package
This will build the installer .exe
If you do not need support for some SDRs (or you have problems building their libraries), they can be disabled individually with -DENABLE_BLADERF=OFF -DENABLE_IIO=OFF -DENABLE_MIRISDR=OFF ... etc.
To build with Qt 6, use -DCMAKE_PREFIX_PATH=C:\Qt\6.7.3\msvc2022_64 and -DENABLE_QT6=ON.
After an initial build of 'ninja package', rather than repeatedly building the installer, you can run SDRangel from the build directory, by just running 'ninja' to rebuild then '.\bin\sdrangel' to run.
Passing -DCMAKE_BUILD_TYPE=Debug
or -DCMAKE_BUILD_TYPE=RelWithDebInfo
(lighter but may be less precise) to the cmake command will create a version that is easier to debug for yourself or the maintainers.
Passing -DHIDE_CONSOLE=OFF will enable debug output (qDebug()) to the command prompt.
Debugging
To debug using Visual Studio without a project, run:
devenv /DebugExe .\bin\SDRangel.exe
Compile and Build (Visual Studio)
- Clone the repo https://github.com/f4exb/sdrangel.git in Visual Studio
- Open the sdrangel folder
- Modify CMake presets (Edit CMakePresets.json and ensure CMAKE_PREFIX_PATH has the correct path to Qt and Boost)
- Build > Build All
- Select Startup Item > Show / hide debug targets
- Uncheck Select All then Check sdrangel.exe (bin\sdrangel.exe)
- Select Startup Item > sdrangel.exe
Git settings
If Commit Staged button is greyed out:
- Tools > Options
- Source Control > Git Repository Settings > General
- Set github username and e-mail
- Restart Visual Studio
Notes
MSVC compiles std::string incompatibly for Release and Debug builds, which means you can't mix different builds of libraries that include std::string in their APIs such as the UHD library. There's currently only a Release build of uhd.dll in the sdrangel-windows-externals repo. This will cause an exception if used with a Debug build of SDRangel. As a workaround, you'll need to either delete uhd.dll before debugging, or replace it with a Debug version you've built.
The debug libraries for OpenCV are too large for github (>100MB), so have been zipped. If doing a debug build, these files should be extracted in sdrangel\external\windows\opencv4\x64\vc16\bin
- Home
- Quick start
- Quick start legacy (v6)
- Hardware requirements
- High DPI displays
- Compile in Linux
- Compile in Windows
- Compile in MacOS
- History and major releases
- Audio related
- Plugins
- Advanced
- Server and API