I am trying to compile the gazebo example provided by [PX4](https://github.com/PX4/Firmware), according to [PX4's instructions](https://dev.px4.io/master/en/simulation/gazebo.html#running-the-simulation). I am working on Ubuntu-18.04.

When running the command: `make px4_sitl gazebo`, following error occurs:

```
...
In file included from Range.pb.h:27:0,
                 from Range.pb.cc:5:
/usr/include/gazebo-9/gazebo/msgs/quaternion.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^~~~~
/usr/include/gazebo-9/gazebo/msgs/quaternion.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^~~~~
/usr/include/gazebo-9/gazebo/msgs/quaternion.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^~~~~
...

```

Piecing the error message back together gives: *This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer headers. Please update your headers.*

I have two different `protoc` binaries on my machine:

* `/usr/bin/protoc` (3.0.0), the minimum version required
* `~/catkin_ws/devel/bin/protoc` (2.6.0), which is too old and used by default

How can I make sure the first version is used? I tried this: `export PATH=/usr/bin:$PATH` to make sure the right compiler is found first but I would also probably need to indicate to use the right headers, hence the ones in `/usr/include/google/protobuf` instead of `~/catkin_ws/devel/include/google/protobuf`. However, I am not sure about how to proceed.