对protobuf类型题目的环境搭建

安装protobuf

下载:https://github.com/protocolbuffers/protobuf/releases

根据其readme.txt安装即可

报错:

1
2
3
4
❯ protoc --c_out=./heapProto.h ./heap.proto
protoc-gen-c: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--c_out: protoc-gen-c: Plugin failed with status code 1.

缺少依赖

1
sudo apt install protobuf-c-compiler

安装pbkt

下载:https://github.com/marin-m/pbtk

其readme有点搞,可能是因为版本太久没更新的缘故,apt安装需要更换为以下:

1
2
3
4
5
sudo apt install python3-pip git openjdk-11-jre libqt5x11extras5 python3-pyqt5.qtwebengine python3-pyqt5
sudo pip3 install protobuf pyqt5 pyqtwebengine requests websocket-client
git clone https://github.com/marin-m/pbtk
cd pbtk
./gui.py