Restbed C++编译 之Windows+Linux
一、Windows
0、依赖
为了简化编译,提前安装openssl库,直接下载win安装包即可,并配置环境变量,并重启电脑更新环境变量,详情见参考文章
1、下载源代码:https://github.com/Corvusoft/restbed,或者
git clone https://github.com/Corvusoft/restbed.git
2、递归子模块
git submodule update --init
或者直接下载相应库,详情见参考文章
3、编译
如果编译前安装了openssl库,则将restbed\dependency\openssl文件夹改名或删除,防止cmake链接openssl至此文件
mkdir build
cd build
cmake [-DBUILD_SSL=NO] [-DBUILD_TESTS=NO] ..
4、VS打开sln编译即可
二、Linux(Centos7)
0、依赖
安装依赖
sudo yum install git cmake gcc-c++
安装openssl库,详情见参考文章
1、下载源代码
git clone https://github.com/Corvusoft/restbed.git
2、递归子模块
git submodule update --init
3、编译
如果编译前安装了openssl库,则将restbed\dependency\openssl文件夹改名或删除,防止cmake链接openssl至此文件
mkdir build cd build cmake [-DBUILD_SSL=NO] [-DBUILD_TESTS=NO] .. make -j4 make install