# 2020-10-09 #「Synergy」- 編譯安裝(2.0.0)


注意事項

目前(09/28/2020),建議使用 Barrier(forked from symless/Synergy.html" title="Synergy" class="page">Synergy 產品。

如果堅持使用 Synergy 產品,建議參考 Synergy/Installation 筆記的「使用 二進制包 安裝」部分。

源碼編譯安裝(Linux)

雖然官網提供編譯好的包,但是要付費購買。

詳細的編譯細節可以參考 Github 倉庫中的 Wiki:https://github.com/symless/synergy-core/wiki/Compiling
編譯通過的系統:Kali GNU/Linux Rolling、Max OSX 10.12.6

系統環境:Kali GNU/Linux Rolling
Synergy版本:2.0.0

安裝依賴,准備,編譯,安裝:

# 安裝依賴(參照文檔中的Debian7/8)
apt-get install build-essential cmake libavahi-compat-libdnssd-dev \
		libcurl4-openssl-dev libssl-dev lintian python \
		qt4-dev-tools xorg-dev fakeroot

# 下載源碼Github Repo:https://github.com/symless/synergy-core
git clone https://github.com/symless/synergy-core.git
cd synergy-core

# 構建並編譯
mkdir build && cd build
cmake ..
make

# 最終編譯生成的文件位於build/bin下。

源碼編譯安裝(macOS)

Mac OSX中安裝Synergy,依舊是參考Github倉庫中的Wiki:https://github.com/symless/synergy-core/wiki/Compiling

系統環境:Max OSX 10.12.6
Synergy版本:2.0.0

安裝依賴,准備,編譯,安裝:

# Install Homebrew

# Install XCode (also available via the Mac App Store)
# You may need to open XCode, go to Preferences, select Locations, and then make sure an option is selected for Command Line Tools.
# Install cmake, Qt, and openssh using Homebrew
brew install cmake
brew install qt
brew install openssh

# Find the path for Qt installation - this should be something like "usr/local/Cellar/qt/4.8.7_2/Frameworks"
brew info qt

# Add the qt installation path from the previous step to the CMAKE_PREFIX_PATH (replace "usr/local/Cellar/qt/4.8.7_2/Frameworks" with the path found in the previous step)

export CMAKE_PREFIX_PATH="usr/local/Cellar/qt/4.8.7_2/Frameworks"

# 下載源碼並進入源碼目錄
git clone https://github.com/symless/synergy-core.git
cd synergy-core
mkdir build
cd build
# 准備
cmake -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk \
	-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_OSX_ARCHITECTURES=x86_64 ..

# 編譯
make

安裝的二進制程序

在 Synergy-v2.0.0 中包含的程序

synergyc

synergy-core

synergys

常見錯誤匯總

#1 dns_sd.h: No such file or directory

-Itmp/release -I. -o tmp/release/ZeroconfRegister.o src/ZeroconfRegister.cpp
In file included from src/ZeroconfRegister.cpp:18:0:
src/ZeroconfRegister.h:32:20: fatal error: dns_sd.h: No such file or directory

解決:安裝libavahi-compat-libdnssd-dev

#2 make: /usr/lib/x86_64-linux-gnu/qt4/bin/uic: Command not found

......
Entering dir: src/gui
make: Entering directory '/mnt/extra320g/pkg/synergy/src/gui'
/usr/lib/x86_64-linux-gnu/qt4/bin/uic res/MainWindowBase.ui -o ui_MainWindowBase.h
make: /usr/lib/x86_64-linux-gnu/qt4/bin/uic: Command not found
Makefile:497: recipe for target 'ui_MainWindowBase.h' failed
make: *** [ui_MainWindowBase.h] Error 127
make: Leaving directory '/mnt/extra320g/pkg/synergy/src/gui'
Going back to: /mnt/extra320g/pkg/synergy
Error: make -w failed with error: 512

解決:安裝libqt4-dev-bin。如果你使用的是其他發行版,可能會使別的名字,可以參考另外一篇文章:《如何查找某個文件所屬的軟件包》

#3 fatal error: QApplication: No such file or directory

de/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Isrc -I../lib/shared -Itmp/release -I. -o tmp/release/main.o src/main.cpp
In file included from src/main.cpp:22:0:
src/QSynergyApplication.h:23:24: fatal error: QApplication: No such file or directory
compilation terminated.
Makefile:561: recipe for target 'tmp/release/main.o' failed
make: *** [tmp/release/main.o] Error 1

原因:因為缺少相關的頭文件。
解決:安裝libqt4-dev。如果你使用的是其他發行版,可能會使別的名字,可以參考另外一篇文章:《如何查找某個文件所屬的軟件包》

#4 ERROR: ipc connection error, connection refused

Windows中啟動Synergy以后,總是提示:

[2017-10-03T00:12:44] ERROR: ipc connection error, connection refused

解決方法,在服務管理里面,啟動 synergy 服務即可:

參考文獻

 

 



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM