参考:https://crowcpp.org/master/getting_started/setup/linux/
https://github.com/CrowCpp/Crow
git clone https://github.com/CrowCpp/Crow.git
mkdir build
cmake ..
make
效果:
Crow/build/examples下运行

测试访问结果
***自己编写例子
crow_hello.cpp
#include
int main(){
crow::SimpleApp app;
//测试
CROW_ROUTE(app, "/test")([](){
return "Hello world";
});
app.port(18888).multithreaded().run();
}
编译:
如果不添加-lboost_system会报错undefined reference to `boost::system::generic_category();
-lpthread 会报错 undefined reference to symbol ‘pthread_sigmask@@GLIBC_2.2.5’
g++ crow_hello.cpp -o crow_hello -lboost_system -lpthread
运行:


参考:https://blog.csdn.net/weixin_54227557/article/details/124514186
sudo rm -rf /usr/bin/cmake
wget https://cmake.org/files/v3.16/cmake-3.16.8-Linux-x86_64.tar.gz
tar zxvf cmake-3.16.8-Linux-x86_64.tar.gz
sudo ln -s /data/loong/cmake-3.16.8-Linux-x86_64/bin/cmake /usr/bin/cmake
cmake --version
1)pthread
sudo apt install doxygen
2)boost
安装如果出现E: Failed to fetch;参考https://blog.csdn.net/davidietop/article/details/88909622

sudo apt-get install libboost-all-dev --fix-missing
3)asio
下载解压https://think-async.com/Asio/LatestStableRelease.html:
wget https://sourceforge.net/projects/asio/files/asio/1.22.2%20%28Stable%29/asio-1.22.2.zip/download
unzip download
安装:
cd asio-1.22.2
./configure --without-boost
make
sudo make install
***安装完再去重新cmake、make Crow

