作者:康林 kl222@126.com
Ubuntu
~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
Debian
~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
版本:v12.0.2。建议使用 v5.0.2 及以后版本,以前版本对 CMake 支持不够。
安装开发工具软件包
~$ sudo apt install build-essential
编译器
GCC/G++
~$ sudo apt install g++ gcc
automake、autoconf、make、fakeroot
~$ sudo apt install automake autoconf make fakeroot
~$ sudo apt install git
CMAKE: http://www.cmake.org
版本: 3.27.0
~$ sudo apt install cmake
打包工具: debhelper
~$ sudo apt install debhelper
Qt
Qt 官方发行版本: https://download.qt.io/official_releases/qt/
Qt5: 当前版本: Qt 5.12.12
系统自带:
~$ sudo apt install qttools5-dev qttools5-dev-tools qtbase5-dev qtbase5-dev-tools qtmultimedia5-dev qtlocation5-dev libqt5svg5-dev libqtermwidget5-0-dev
Qt6: 当前版本:6.4.2
系统自带:
~$ sudo apt install qt6-tools-dev qt6-tools-dev-tools qt6-base-dev qt6-base-dev-tools qt6-qpa-plugins libqt6svg6-dev qt6-l10n-tools qt6-translations-l10n qt6-scxml-dev qt6-multimedia-dev libqt6serialport6-dev qt6-webengine-dev qt6-webengine-dev-tools
[可选] IDE: Qt Creator。建议使用 v5.0.2 及以后版本,以前版本对 CMake 支持不够。
~$ sudo apt install qtcreator
Doxygen: http://www.doxygen.nl/
~$ sudo apt install doxygen
此库默认放在与本项目同级目录下,如果没有在同级目录下,则必须指定 CMake 参数: -DRabbitCommon_DIR=[RabbitCommon 安装目录]
~$ git clone https://github.com/KangLin/RabbitCommon.git
使用系统预编译开发库
~$ sudo apt install freerdp2-dev
使用 vcpkg
源码位置: https://github.com/microsoft/vcpkg/
~$ git clone https://github.com/microsoft/vcpkg.git
~$ cd vcpkg
~/vcpkg$ ./bootstrap-vcpkg.sh
~/vcpkg$ vcpkg install freerdp
指定 CMake 参数:-DCMAKE_TOOLCHAIN_FILE=[vcpkg 安装目录]/scripts/buildsystems/vcpkg.cmake
使用 vcpk , FreeRDP 服务不是默认功能,所以需要你手动指定。
从源码编译
编译详见:https://github.com/FreeRDP/FreeRDP/wiki/Compilation
~$ git clone https://github.com/FreeRDP/FreeRDP.git
~$ cd FreeRDP
~/FreeRDP$ mkdir build
~/FreeRDP/build$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/install -DWITH_SERVER=ON
~/FreeRDP/build$ cmake --build . --config Release --target install
指定 CMake 参数:
使用系统预编译开发库
~$ sudo apt install libvncserver-dev
从源码编译
从源码编译 源码位置: https://github.com/KangLin/RabbitVNC
~$ sudo apt install libpixman-1-dev
~$ git clone https://github.com/KangLin/RabbitVNC.git
~$ cd RabbitVNC
~/RabbitVNC$ mkdir build
~/RabbitVNC$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/install
~/RabbitVNC$ cmake --build . --config Release --target install
指定 CMake 参数:-DRabbitVNC_DIR=[RabbitVNC 安装目录]/lib/cmake/RabbitVNC
官方只是个应用程序,不支持库。详见:https://github.com/TigerVNC/tigervnc/issues/1123
所以本人在官方基础上做了修改。源码位置:https://github.com/KangLin/tigervnc
~$ sudo apt install libpixman-1-dev
~$ git clone https://github.com/KangLin/tigervnc.git
~$ cd tigervnc
~/tigervnc$ mkdir build
~/tigervnc$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/install
~/tigervnc$ cmake --build . --config Release --target install
源码位置: https://github.com/microsoft/vcpkg/
~$ git clone https://github.com/microsoft/vcpkg.git
~$ cd vcpkg
~/vcpkg$ vcpkg install libdatachannel
指定 CMake 参数:-DCMAKE_TOOLCHAIN_FILE=[vcpkg 安装目录]/scripts/buildsystems/vcpkg.cmake
编译详见: https://github.com/paullouisageneau/libdatachannel/blob/master/BUILDING.md
~$ git clone https://github.com/paullouisageneau/libdatachannel.git
~$ cd libdatachannel
~/libdatachannel$ git submodule update --init --recursive
~/libdatachannel$ mkdir build
~/libdatachannel$ cd build
~/libdatachannel/build$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/install
~/libdatachannel/build$ cmake --build . --config Release --target install
指定 CMake 参数: -DLibDataChannel_DIR=[libdatachannel 安装目录]/lib/cmake/LibDataChannel
源码位置: https://github.com/qxmpp-project/qxmpp
~$ git clone https://github.com/qxmpp-project/qxmpp.git
~$ cd qxmpp
~/qxmpp$ mkdir build
~/qxmpp$ cd build
~/qxmpp/build$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/install -DQt5_DIR=[Qt5 安装目录]/lib/cmake/Qt5
~/qxmpp/build$ cmake --build . --config Release --target install
指定 CMake 参数: -DQXmpp_DIR=[QXmpp 安装目录]/lib/cmake/qxmpp
使用系统预编译开发库
~$ sudo apt install libqtermwidget5-0-dev
从源码编译
使用系统预编译开发库
~$ sudo apt install libssh-dev
使用 vcpkg
源码位置: https://github.com/microsoft/vcpkg/
~$ git clone https://github.com/microsoft/vcpkg.git
~$ cd vcpkg
~/vcpkg$ vcpkg install libssh
指定 CMake 参数:-DCMAKE_TOOLCHAIN_FILE=[vcpkg 安装目录]/scripts/buildsystems/vcpkg.cmake
从源码编译
源码位置:: https://github.com/KangLin/qt-solutions/
~$ git clone https://github.com/KangLin/qt-solutions.git
~$ cd qt-solutions
~/qt-solutions$ mkdir build
~/qt-solutions$ cd build
~/qt-solutions/build$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/install
~/qt-solutions/build$ cmake --build . --config Release --target install
指定 CMake 参数: -DQtService_DIR=[QtService 安装目录]/lib/cmake/QtService
下载源码
~$ git clone https://github.com/KangLin/RabbitRemoteControl.git
CMake 参数
如果使用 vcpkg,增加下面参数
编译
命令行编译
不用 vcpkg
~$ cd RabbitRemoteControl
~/RabbitRemoteControl$ mkdir build
~/RabbitRemoteControl/build$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/install
~/RabbitRemoteControl/build$ cmake --build . --config Release --target install
使用 vcpkg
~$ cd RabbitRemoteControl
~/RabbitRemoteControl$ mkdir build
~/RabbitRemoteControl/build$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/install [可选依赖库] -DCMAKE_TOOLCHAIN_FILE=[vcpkg installation path]/scripts/buildsystems/vcpkg.cmake
~/RabbitRemoteControl/build$ cmake --build . --config Release --target install
IDE(Qt Creator) 编译
使用脚本 build_debpackage.sh
设置编译本项目 → CMake 参数为环境变量。例如:
export RabbitVNC_DIR=[RabbitVNC 安装目录]/lib/cmake/RabbitVNC
export tigervnc_DIR=[TigerVNC 安装目录]/lib/cmake/tigervnc
export QtService_DIR=[QtService 安装目录]/lib/cmake/QtService
使用脚本 build_debpackage.sh
./build_debpackage.sh [$QT_ROOT] [$RabbitCommon_DIR]
运行
程序安装在 install/bin 下
~$ cd RabbitRemoteControl
~/RabbitRemoteControl$ cd build/install/bin
~/RabbitRemoteControl$ ./RabbitRemoteControl.sh
注意: 如果插件没有加载。则可能是插件的依赖库没有安装到系统。 你可以把依赖库的目录加入到环境变量 PKG_CONFIG_PATH 中。 你也可以把依赖库的目录加入到 /etc/ld.so.conf 文件中,然后运行 ldconfig 把依赖库加入到系统中。
Ubuntu
# 安装开发工具软件包
~$ sudo apt install build-essential
# 安装工具
~$ sudo apt install git cmake debhelper doxygen
# [可选] 安装 Qt5
~$ sudo apt install qttools5-dev qttools5-dev-tools qtbase5-dev \
qtbase5-dev-tools qtmultimedia5-dev qtlocation5-dev libqt5svg5-dev \
libqtermwidget5-0-dev
# 安装 X 开发库
~$ sudo apt install libxkbcommon-dev libxkbcommon-x11-dev libx11-xcb-dev \
libx11-dev libxfixes-dev
~$ sudo apt install libutf8proc-dev libpam0g-dev #编译 qtermwidget 需要
# 安装依赖库
~$ sudo apt install freerdp2-dev libvncserver-dev libssh-dev libtelnet-dev
~$ sudo apt install debhelper fakeroot
# 安装 pixman ,RabbitVNC 和 TigerVNC 需要它
~$ sudo apt install libpixman-1-dev
# 编译 RabbitVNC
~$ git clone https://github.com/KangLin/RabbitVNC.git
~$ cd RabbitVNC
~$ mkdir build
~/RabbitVNC/build$ cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=`pwd`/install
~/RabbitVNC/build$ cmake --build . --config Release --target install
~/RabbitVNC/build$ cd ~
# 编译 TigerVNC
~$ git clone https://github.com/KangLin/tigervnc.git
~$ cd tigervnc
~$ mkdir build
~/tigervnc/build$ cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=`pwd`/install
~/tigervnc/build$ cmake --build . --config Release --target install
~/tigervnc/build$ cd ~
~$ sudo apt install libqxmpp-dev
# 编译 libdatachannel
~$ git clone https://github.com/paullouisageneau/libdatachannel.git
~$ cd libdatachannel
~/libdatachannel$ git submodule update --init --recursive
~/libdatachannel$ mkdir build
~/libdatachannel$ cd build
~/libdatachannel/build$ cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=`pwd`/install
~/libdatachannel/build$ cmake --build . --config Release --target install
~/libdatachannel/build$ cd ~
# 编译 QtService
~$ git clone https://github.com/KangLin/qt-solutions.git
~$ cd qt-solutions/qtservice
~/qt-solutions/qtservice$ mkdir build
~/qt-solutions/qtservice$ cd build
~/qt-solutions/qtservice/build$ cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=`pwd`/install
~/qt-solutions/qtservice/build$ cmake --build . --config Release --target install
~/qt-solutions/qtservice/build$ cd ~
~$ git clone https://github.com/KangLin/RabbitCommon.git
~$ git clone https://github.com/KangLin/RabbitRemoteControl.git
~$ cd RabbitRemoteControl
~/RabbitRemoteControl$ mkdir build
~/RabbitRemoteControl$ cd build
~/RabbitRemoteControl/build$ cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=`pwd`/install \
-DBUILD_FREERDP=ON \
-DRabbitVNC_DIR=~/RabbitVNC/build/install/lib/cmake/RabbitVNC \
-Dtigervnc_DIR=~/tigervnc/build/install/lib/cmake/tigervnc \
-DLibDataChannel_DIR=~/libdatachannel/build/install/lib/cmake/LibDataChannel \
-DQtService_DIR=~/qt-solutions/qtservice/build/lib/cmake/QtService
~/RabbitRemoteControl/build$ cmake --build . --config Release --target install
参见:编译集成
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。