Compiling

Symeon Huang edited this page May 21, 2018 · 21 revisions

Build Dependencies

Make sure you've installed all dependent development packages (with -dev or -devel).

  • cmake >= 3.1.0
  • qt5-qtbase-gui >= 5.2 (qtbase5 in Debian/Ubuntu)
  • qrencode (libqrencode in Debian/Ubuntu)
  • libQtShadowsocks >= 1.10.0 (libqtshadowsocks in Debian/Ubuntu. DON'T use the trunk code)
  • zbar (libzbar0 or libzbar in Debian/Ubuntu)
  • libappindicator (libappindicator1 in Debian/Ubuntu)

Check libQtShadowsocks Compiling wiki if you need to build it yourself.

Compiling

GNU/Linux

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install

macOS

Check libQtShadowsocks Building on macOS page before you proceed.

Requirements

Dependencies

brew update
brew install libqrencode zbar

Installation

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
make
make install

To create an Xcode project, use qmake -spec macx-xcode

qt-build-environment

After install dependencies mentioned in Wiki, you need to setup build environment as following:

  1. Add /usr/local/bin to PATH
  2. Add environment variable PKG_CONFIG_PATH with value /path/to/qrencode/pkgconfig

If you got following messages, please refer to corresponding solutions:

Message:

dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
The program has unexpectedly finished.

Solution:

➜  ls -l /usr/local/lib/libJPEG.dylib
lrwxr-xr-x  1 hzxie  admin  35 Feb 16 22:57 libJPEG.dylib -> ../Cellar/jpeg/8d/lib/libjpeg.dylib
➜  rm /usr/local/lib/libJPEG.dylib
➜  ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libJPEG.dylib /usr/local/lib/libJPEG.dylib

Message:

dyld: Symbol not found: __cg_TIFFClientOpen
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libTIFF.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
The program has unexpectedly finished.

Solution:

➜  ls -l /usr/local/lib/libTIFF.dylib
lrwxr-xr-x  1 hzxie  admin  43 Feb 16 22:57 /usr/local/lib/libTIFF.dylib -> ../Cellar/libtiff/4.0.7_2/lib/libtiff.dylib
➜  rm /usr/local/lib/libTIFF.dylib
➜  ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libTIFF.dylib /usr/local/lib/libTIFF.dylib

Message:

dyld: Symbol not found: __cg_png_create_info_struct
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libPng.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
The program has unexpectedly finished.

Solution:

➜  ls -l /usr/local/lib/libPng.dylib
lrwxr-xr-x  1 hzxie  admin  40 Feb 16 20:34 /usr/local/lib/libPng.dylib -> ../Cellar/libpng/1.6.28/lib/libpng.dylib
➜  rm /usr/local/lib/libPng.dylib
➜  ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libPng.dylib /usr/local/lib/libPng.dylib
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.