Errors while it is building for the gazebo simulation

Hi, everyone.
I have just updated my code from v1.11.0 to v1.12.1. And it gets errors while it is building for gazebo simulation. What is the problem? And how could I fix it? thank you.
the errors:

[0/5] Performing build step for 'sitl_gazebo'

[1/108] Building CXX object CMakeFiles...lugin.dir/src/gazebo_wind_plugin.cpp.o

FAILED: CMakeFiles/gazebo_wind_plugin.dir/src/gazebo_wind_plugin.cpp.o

In file included from /usr/local/include/gazebo-11/gazebo/transport/transport.hh:3:
/usr/local/include/gazebo-11/gazebo/transport/Connection.hh:57:65: error: expected class name
    class GZ_TRANSPORT_VISIBLE ConnectionReadTask : public tbb::task
/usr/local/include/gazebo-11/gazebo/transport/Connection.hh:73:20: error: no type named 'task' in namespace 'tbb'
      public: tbb::task *execute()
/usr/local/include/gazebo-11/gazebo/transport/Connection.hh:313:61: error: no member named 'allocate_root' in namespace 'tbb::v1::task'
                  ConnectionReadTask *task = new(tbb::task::allocate_root())
/usr/local/include/gazebo-11/gazebo/transport/Connection.hh:315:19: error: no type named 'enqueue' in namespace 'tbb::v1::task'; did you mean 'ifqueue'?
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/net/if_var.h:230:9: note: 'ifqueue' declared here
struct  ifqueue {
8 errors generated.

I found that the compilation of the gazebo-sim has a warning. Dose it relate to the errors?
the warning:

CMake Warning (dev) at /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (gazebo).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.21.2/share/cmake/Modules/FindPkgConfig.cmake:70 (find_package_handle_standard_args)
  /usr/local/lib/cmake/gazebo/gazebo-config.cmake:62 (include)
  CMakeLists.txt:48 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

Hi @kevindsp, you can try downgrading to gazebo 9 to try it out, seem like this is a versioning problem and some modules may be deprecated and changed. I’m always using 9.19 and Ubuntu 18.04, ROS melodic would download a gazebo 9 for you too.
You can run the code in terminal below

sudo apt-get remove gazebo11*
# ... check whether you added the ppa/sources list if needed
sudo sh -c 'echo "deb `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y gazebo9 libgazebo9-dev

@matthewoots Just chiming in to clarify the level of support for gazebo11.

If this is running on Ubuntu, gazebo 11 and Ubuntu 20.04 is the most well supported simulation environment.

For Ubuntu 18.04, gazebo9 is the standard supported version, but gazebo 11 also works.

1 Like

Thanks for your help.
Mattthewoots and Jaeyoung. I have fixed the problem after many Times of cleaned up and installed everything on my MAC. The problem is caused by the Mac’s self build-in pythons. After it has been cleaned up. Then the gazebo works!
here’s the related issue:

1 Like