# Manually Build Qv2ray
In case a hacker wants to compile Qv2ray manually.
# 0. Requirements and Dependencies
Please make sure you have already met all the requirements.
x64-only for desktop platforms.
x86_64for Android platform.
>= 5.11is required for desktop platforms,
>= 6.0required for Android.
Never mind when you are porting Qv2ray to a earlier or later version of Qt.
- In that case, you may want to modify
The latest version of Qt is always supported and recommended
A compiler with
gcc7is known to be good to go.
- At least version 14.2 of MSVC is required.
Third-party libraries: (gRPC, protobuf, curl, openssl)
Target Platform Installation Method Linux Install corresponding packages Windows (MSVC) Use
vcpkgor use prebuilt binaries
Windows (MinGW) See Below macOS Install packages via
homebrew, (note: curl is pre-installed)
Android Linux host is supported, use prebuilt binaries,
Extra Git Submoule for Android
android-openssl (opens new window) provides OpenSSL binaries: use
git clone https://github.com/KDAB/android_openssl 3rdparty/android-openssl
# a. Prebuilt Binaries
- The Qv2ray-deps (opens new window) repo is where we build and provide pre-built library dependencies for targeting Windows and Android.
- For Android version, we have used a patched (opens new window) vcpkg.
# a.1 Download / Extraction Script
Extra Dependencies: bash, jq, curl, 7zip (Especially for Windows Users)
We have provided
./libs/setup-lib.sh to make it easy to install prebuilt binaries, usage:
./setup-libs <PLATFORM> <ARCH>
./setup-libs.sh windows x64or
./setup-libs.sh android arm
toolsto install Protobuf generator binaries when cross-compiling to Android on Linux
The script downloads packages from this release (opens new window) and extract, move contents to corrensponding
# a.2 Manually Obtaining Prebuilt Binaries
- Download the 7z files
- Extract and move the
- There must be
# MinGW Packages:
MSYS2 is suggested, packages:
# 1. Obtaining Source Tree
There are various approaches to obtain the source code of Qv2ray. You can get it from:
- Directly download the source code of a branch (never do this due to the lack of git submodule metadata.)
You can append options after `git clone`
--branch <branch/tag> To checkout the specific branch/tag after clone is created.
Qv2ray contains nested submodules, always use
--recursive when cloning.
# 2. Entering Compilation Directory
The following steps requires a proper
PATH, that is,
qmake could be found in the
mkdir build; cd build;
- Simply to prevent pollutions in the source tree.
# 3. Generate Compilation Scripts
You need to check for CMake Argument References and add your own ones.
For Android, using
qt-cmake .. is suggested instead of
CMAKE_INSTALL_PREFIXis always suggested, for packaging and collect all required files in one go.
CMAKE_BUILD_TYPEis always suggested, see CMake Documentation (opens new window)
Releasebuild will have different names for Qv2ray config directories, to prevent a development build from damaging the working copy of configurations.
-GNinjais suggested, iff you have
ANDROID_NDK_ROOTmay be required for Android.
# 4. Start Compilation
cmake --build .
--parallel <NUMBER>is sugguest if you have enough computation power and want to perform parallel compilations.
# 5. Finalize Compilation
Copy compiled artifacts and resources, into the destination directory.
cmake --install . or with
- This will automatically copy all dependencies into
There's a bug in
libabsl_debugging_internal is recognized as a debug library. Which prevents QPlatformPlugin (i.e. QCocoaPlugin) from being deployed. This causes a runtime exception telling that "No Platform Plugin is Found".
macdeployqt (opens new window) instead. Which supports both Qt5 and Qt6
# 6. Done
You have your Qv2ray compiled and deployed!
Start hacking and welcome to contribute Qv2ray!