我正在尝试在EOS智能合约中包含boost UUID 库。
#include <string>
#include <eosio/crypto.hpp>
#include <boost/uuid/uuid.hpp>
我按照此链接安装 boost 只是将版本更改为 1.73.0:http: //janisz.github.io/2013/11/27/install-boost-on-ubuntu/
我执行的命令列表是:
sudo apt-get update
sudo apt-get -y --purge remove libboost-all-dev libboost-doc libboost-dev
sudo apt-get -y install build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev
cd /tmp
wget http://downloads.sourceforge.net/project/boost/boost/1.73.0/boost_1_73_0.tar.gz
tar -zxvf boost_1_73_0.tar.gz
cd boost_1_73_0
./bootstrap.sh --prefix=/usr/local
cpuCores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | awk '{print $NF}'`
echo "Available CPU cores: "$cpuCores
sudo ./b2 --with=all -j $cpuCores install
在这之后:
./bootstrap.sh --prefix=/usr && ./b2 stage threading=multi link=shared
./b2 install threading=multi link=shared && ln -svf detail/sha1.hpp /usr/include/boost/uuid/sha1.hpp
./b2 命令打印
ln: 未能创建符号链接 '/usr/include/boost/uuid/sha1.hpp': 权限被拒绝
然后:
sudo apt update
sudo apt install libboost-all-dev
并尝试编译智能合约:
eosio-cpp documentid.cpp -o documentid.wasm
它给出的错误:
fatal error: 'boost/uuid/uuid.hpp' file not found
有人能告诉我我做错了什么吗?