How to install flatc and flatbuffers on linux ubuntu

Olexandr Akhtyrskyi picture Olexandr Akhtyrskyi · Mar 28, 2019 · Viewed 9.8k times · Source

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.

Answer

Olexandr Akhtyrskyi picture Olexandr Akhtyrskyi · Mar 28, 2019

solution for flatc and flatbuffers for linux ubuntu :

  1. choice "folder for installation"
  2. cd "folder for installation"
  3. git clone https://github.com/google/flatbuffers.git
  4. cd flatbuffers
  5. cmake -G "Unix Makefiles" (install cmake if need)
  6. make
  7. sudo ln -s /full-path-to-flatbuffer/flatbuffers/flatc /usr/local/bin/flatc
  8. chmod +x /full-path-to-flatbuffer/flatbuffers/flatc
  9. run in any place as "flatc"