Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install flatc and flatbuffers on linux ubuntu

if we install flatbuffers on Linux Ubuntu, we will not be able to use the shortc flatc command from anywhere to compile, how can we do this?

For example: i want use in package.json some command "flatc -o path/src/app/core/providers/flatbuffers ....."

in order to do this not enough to install flatbuffers, we also need to carry out a number of additional manipulations - add a symbolic link and so on.

like image 762
Olexandr Akhtyrskyi Avatar asked Mar 28 '19 09:03

Olexandr Akhtyrskyi


1 Answers

In Ubuntu 20.04 (focal) it's in apt repository already (https://packages.ubuntu.com/focal/flatbuffers-compiler) so you can just install it:

sudo apt update
sudo apt install -y flatbuffers-compiler

And for Ubuntu 18.04 (bionic) you can use PPA (https://launchpad.net/~hnakamur/+archive/ubuntu/flatbuffers):

sudo apt-add-repository ppa:hnakamur/flatbuffers
sudo apt update
sudo apt install -y flatbuffers-compiler

Both are a little old (1.11), but if you don't use latest features, then this should be quite solid.

like image 74
Gea-Suan Lin Avatar answered Oct 21 '22 17:10

Gea-Suan Lin