「Shadowsocks」- Shadowsocks-Qt5(图形化客户端)

  CREATED BY JENKINSBOT

通过仓库直接安装

有些发行版的源中并没有提供Shadowsocks-Qt5的二进制包,只能使用源码进行编译。参考源码编译部分。

通过源码编译安装

安装依赖

安装源中存在的依赖:

apt-get install libqrencode3 libqrencode-dev libzbar0 libzbar-dev \
        libbotan-1.10-0 libbotan1.10-dev qtbase5-dev

Shadowsocks-Qt5 还依赖库 libQtShadowsocks,所以需要编译安装:

git clone https://github.com/shadowsocks/libQtShadowsocks.git
cd libQtShadowsocks/

# 安装需要的依赖
apt-get install cmake qtbase5-dev libbotan1.10-dev \
    libbotan-2-4 libbotan-2-dev

# 创建构建目录,与源码隔离
# 默认的安装目录为:/usr/local
# 查看构建的选项:cmake .. -L
mkdir build && cd build
cmake .. && make && make install    # 构建、安装

# Github Repo: https://github.com/shadowsocks/libQtShadowsocks
# Github Wiki: https://github.com/shadowsocks/libQtShadowsocks/wiki/Installation

编译安装

git clone https://github.com/shadowsocks/shadowsocks-qt5.git
cd shadowsocks-qt5 && mkdir build && cd build

# 查看构建选项
cmake .. -L

# 构建并安装
# 默认的安装目录为/usr/local
cmake .. && make && make install

运行测试

#!/bin/bash

/usr/local/bin/ss-qt5

安装的可执行程序

ss-qt5,shadowsocks的GUI客户端。

常见的编译及运行错误

#1 libQtShadowsocks.so.2: cannot open shared object file

ss-qt5: error while loading shared libraries: libQtShadowsocks.so.2: cannot open shared object file: No such file or directory

已遇见的原因有两个:
1)依赖库libQtShadowsocks没有安装;
2)安装了依赖库,但是没有库所在的位置没有在库的搜索路径中。

# libQtShadowsocks :

/mnt/uui/packages/libQtShadowsocks/lib/cipher.cpp: In destructor ‘virtual QSS::Cipher::~Ciphe()’:
/mnt/uui/packages/libQtShadowsocks/lib/cipher.cpp:108:9: error: ‘kdf’ was not declared in this scope
	 if (kdf)    delete kdf;
		 ^~~
/mnt/uui/packages/libQtShadowsocks/lib/cipher.cpp:108:24: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
	 if (kdf)    delete kdf;
						^~~
/mnt/uui/packages/libQtShadowsocks/lib/cipher.cpp:109:9: error: ‘msgAuthCode’ was not declared in this scope
	 if (msgAuthCode)    delete msgAuthCode;
		 ^~~~~~~~~~~
...

原因:不知道
解决:额,原来从git上检出的源码在master分支上,我切换到stable分支以后重新编译的,就没有错误了。

# libQtShadowsocks :

-- Checking for one of the modules 'botan-2>=2.3.0;botan-1.10'
CMake Deprecation Warning at CMakeLists.txt:28 (message):
  Botan-1.10 is found and will be used in this build.  However, Botan-1.10 is
  deprecated and should not be used if possible

原因:Botan-1.10库不再推荐。需要安装botan-2>=2.3.0以上的库。虽然这并不是一个错误。
系统:Kali GNU/Linux Rolling
解决:apt-get install libbotan-2-4 libbotan-2-dev

# libQtShadowsocks : None of the required ‘botan-2>=2.3.0;botan-1.10’ found

-- Checking for one of the modules 'botan-2>=2.3.0;botan-1.10'
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:645 (message):
  None of the required 'botan-2>=2.3.0;botan-1.10' found
Call Stack (most recent call first):
  CMakeLists.txt:23 (pkg_search_module)

CMake Deprecation Warning at CMakeLists.txt:28 (message):
  Botan-1.10 is found and will be used in this build.  However, Botan-1.10 is
  deprecated and should not be used if possible

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
BOTAN_LIBRARY_VAR
	linked by target "QtShadowsocks" in directory /mnt/uui/package/libQtShadowsocks/lib

-- Configuring incomplete, errors occurred!
See also "/mnt/uui/package/libQtShadowsocks/build/CMakeFiles/CMakeOutput.log".

系统:Kali GNU/Linux Rolling
原因:Botan库没有安装;或者是pkg-config没有安装。
解决:apt-get install libbotan-2-4 libbotan-2-dev pkg-config

参考文献

项目Shadowsocks-Qt5在GitHub中的地址
Shadowsocks-Qt5在Github中的Wiki页面