下载socket.IO
git clone https://github.com/socketio/socket.io-client-cpp.git
socketio 依赖环境
cd socket.io-client-cpp/lib
rm rapidjson -rf
git clone https://github.com/Tencent/rapidjson.git
rm websocketpp -rf
git clone https://github.com/zaphoyd/websocketpp.git
/home/buji/Projects/socket.io-client-cpp/lib目录结构如下: |
boost
boost下载(boost_1_78_0.tar.gz)
sudo ./bootstrap.sh --prefix=/home/buji/Downloads/boost_1_78_0/output
sudo ./b2 install
参考另一篇文章
linux c++ vscode 搭建流媒体服务器_wangbuji的博客-优快云博客_c++流媒体服务器
socket.io编译
默认编译静态库,可以修改CMakeList文件编译动态库。
option(BUILD_SHARED_LIBS "Build the shared library" ON)
cmake -DBOOST_ROOT:STRING=/home/buji/Downloads/boost_1_78_0/output -DBOOST_VER:STRING=1.78.0
踩坑记录: cmake 报错 CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.10 or higher is requir 解决方案: sudo apt remove cmake ./configure make sudo make install |
sudo make
sudo make install