1) 先安装boost库
依赖工具
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
export LD=aarch64-linux-gnu-ld
sudo apt-get install build-essential
./bootstrap.sh --with-toolset=gcc
project-config.jam 文件修改为
if ! [ feature.values <toolset> : gcc ]
{
using gcc : aarch64 : /usr/bin/aarch64-linux-gnu-g++ ;
}
b2 工具是boost库推荐的安装编译工具
执行 ./b2
./b2 install
安装成功后提示
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/home/hongyawx/boost_1_83_0
The following directory should be added to linker library paths:
/home/hongyawx/boost_1_83_0/stage/lib
2) 编译 websocketpp
aarch64-linux-gnu-g++ echo_server.cpp -o echo_server -lpthread -lboost_system -I /usr/local/include -I /home/hongyawx/wuxu/websocketpp-master
编译 examples下的 echo_server.cpp 程序