💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ### 编译libShadowQT ***** ### For MacOS: (1) Qt5 ``` $ brew install qt5 $ echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile ``` (2) botan ``` brew install botan brew link botan ``` (3) libQtShadowsocks ``` mkdir build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local make all make install ``` 如果编译不通过 错误: ``` �when I try to build, i fond this error. who can help me? help. C:/msys64/home/Administrator/libQtShadowsocks-2.0.0/lib/cipher.cpp:212:42: required from here C:/msys64/mingw64/include/c++/9.2.0/bits/unique\_ptr.h:79:16: error: invalid application of 'sizeof' to incomplete type 'Botan::Keyed\_Filter' 79 | static\_assert(sizeof(\_Tp)>0, | ^~~~~~~~~~~ \[ 31%\] Building CXX object lib/CMakeFiles/QtShadowsocks.dir/rc4.cpp.obj make\[2\]: \*\*\* \[lib/CMakeFiles/QtShadowsocks.dir/build.make:115:lib/CMakeFiles/QtShadowsocks.dir/cipher.cpp.obj\] 错误 1 make\[2\]: \*\*\* 正在等待未完成的任务.... make\[1\]: \*\*\* \[CMakeFiles/Makefile2:101:lib/CMakeFiles/QtShadowsocks.dir/all\] 错误 2 make: \*\*\* \[Makefile:130:all\] 错误 2 ``` 解决办法:Update cipher.cpp [#218](https://github.com/shadowsocks/libQtShadowsocks/pull/218) ``` #include <botan/filters.h> ``` (4) shadowsocks-qt5 ``` mkdir build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local make make install ``` ### 在qt中使用cmakelist无法导入 ***** 错误: ``` Could not find a package configuration file provided by "Qt5Gui" with any of the following names ``` 解决办法: ``` For downstream users:`brew install <package-using-qt5>`works with CMake because something sets`CMAKE_PREFIX_PATH`. To make CMake recognize Qt5 outside`brew`, add this to CMakeLists.txt before any`find_package(Qt5...)`call: ``` 在CMakelist.txt中添加以下内容: ``` if(APPLE AND EXISTS /usr/local/opt/qt5) # Homebrew installs Qt5 (up to at least 5.9.1) in # /usr/local/qt5, ensure it can be found by CMake since # it is not in the default /usr/local prefix. list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5") endif() ``` brew update brew install libqrencode zbar mkdir build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local make make install ```