Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project template build failed #12

Open
AllenChienXXX opened this issue Oct 25, 2023 · 6 comments
Open

project template build failed #12

AllenChienXXX opened this issue Oct 25, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@AllenChienXXX
Copy link

Hi, I'm following the tutorial and decided to build the project template, but it keeps failed to build and produce a lot of errors. I followed the exact steps in the documentation.
I guess the reason it's generating so many errors is because there are multiple dependencies that are not compatible between my ros2 iron and ignition gazebo fortress?

Environment

  • OS Version: Ubuntu 22.04 LTS on arm64
  • Source or binary build?
    binary build, the latest version

Description

Hi, I'm following the tutorial and decided to build the project template, but it keeps failed to build and produce a lot of errors. I followed the exact steps in the documentation.
I guess the reason it's generating so many errors is because there are multiple dependencies that are not compatible between my ros2 iron and ignition gazebo fortress?

Steps to reproduce

I just follow the exact steps on the tutorial

Output

there are so many errors, I only include the most botton ones:
275 | std::string* Mutable(Arena* arena);
| ^~~~~~~
/home/ubuntu/anaconda3/include/google/protobuf/arenastring.h:275:16: note: candidate expects 1 argument, 2 provided
/home/ubuntu/anaconda3/include/google/protobuf/arenastring.h:276:16: note: candidate: ‘std::string* google::protobuf::internal::ArenaStringPtr::Mutable(const google::protobuf::internal::LazyString&, google::protobuf::Arena*)’
276 | std::string* Mutable(const LazyString& default_value, Arena* arena);
| ^~~~~~~
/home/ubuntu/anaconda3/include/google/protobuf/arenastring.h:276:42: note: no known conversion for argument 1 from ‘const string*’ {aka ‘const std::cxx11::basic_string’} to ‘const google::protobuf::internal::LazyString&’
276 | std::string
Mutable(const LazyString& default_value, Arena* arena);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/ignition/msgs8/ignition/msgs/MessageTypes.hh:226,
from /usr/include/ignition/msgs8/ignition/msgs/Utility.hh:34,
from /home/ubuntu/project_ws/src/ros_gz/ros_gz_sim/src/create.cpp:22:
/usr/include/ignition/msgs8/ignition/msgs/world_modify.pb.h: In member function ‘std::string* ignition::msgs::WorldModify::release_cloned_uri()’:
/usr/include/ignition/msgs8/ignition/msgs/world_modify.pb.h:591:29: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::Release(const string*, google::protobuf::Arena*)’
591 | return cloned_uri
.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/ignition/msgs8/ignition/msgs/entity_factory.pb.h:25,
from /home/ubuntu/project_ws/src/ros_gz/ros_gz_sim/src/create.cpp:16:
/home/ubuntu/anaconda3/include/google/protobuf/arenastring.h:304:35: note: candidate: ‘std::string* google::protobuf::internal::ArenaStringPtr::Release()’
304 | PROTOBUF_NODISCARD std::string* Release();
| ^~~~~~~
/home/ubuntu/anaconda3/include/google/protobuf/arenastring.h:304:35: note: candidate expects 0 arguments, 2 provided
In file included from /usr/include/ignition/msgs8/ignition/msgs/MessageTypes.hh:226,
from /usr/include/ignition/msgs8/ignition/msgs/Utility.hh:34,
from /home/ubuntu/project_ws/src/ros_gz/ros_gz_sim/src/create.cpp:22:
/usr/include/ignition/msgs8/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_allocated_cloned_uri(std::string*)’:
/usr/include/ignition/msgs8/ignition/msgs/world_modify.pb.h:599:27: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::SetAllocated(const string*, std::string*&, google::protobuf::Arena*)’
599 | cloned_uri
.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), cloned_uri,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
600 | GetArena());
| ~~~~~~~~~~~
In file included from /usr/include/ignition/msgs8/ignition/msgs/entity_factory.pb.h:25,
from /home/ubuntu/project_ws/src/ros_gz/ros_gz_sim/src/create.cpp:16:
/home/ubuntu/anaconda3/include/google/protobuf/arenastring.h:309:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::SetAllocated(std::string*, google::protobuf::Arena*)’
309 | void SetAllocated(std::string* value, Arena* arena);
| ^~~~~~~~~~~~
/home/ubuntu/anaconda3/include/google/protobuf/arenastring.h:309:8: note: candidate expects 2 arguments, 3 provided
In file included from /usr/include/ignition/msgs8/ignition/msgs/MessageTypes.hh:226,
from /usr/include/ignition/msgs8/ignition/msgs/Utility.hh:34,
from /home/ubuntu/project_ws/src/ros_gz/ros_gz_sim/src/create.cpp:22:
/usr/include/ignition/msgs8/ignition/msgs/world_modify.pb.h: In member function ‘std::string* ignition::msgs::WorldModify::unsafe_arena_release_cloned_uri()’:
/usr/include/ignition/msgs8/ignition/msgs/world_modify.pb.h:607:22: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘UnsafeArenaRelease’
607 | return cloned_uri_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
| ^~~~~~~~~~~~~~~~~~
/usr/include/ignition/msgs8/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::unsafe_arena_set_allocated_cloned_uri(std::string*)’:
/usr/include/ignition/msgs8/ignition/msgs/world_modify.pb.h:618:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘UnsafeArenaSetAllocated’
618 | cloned_uri_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
| ^~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/create.dir/build.make:76: CMakeFiles/create.dir/src/create.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:159: CMakeFiles/create.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Failed <<< ros_gz_sim [5.32s, exited with code 2]
Aborted <<< ros_ign_interfaces [2.04s]
Aborted <<< ros_gz_bridge [14.0s]

Summary: 7 packages finished [17.7s]
1 package failed: ros_gz_sim
2 packages aborted: ros_gz_bridge ros_ign_interfaces
3 packages had stderr output: ros_gz_bridge ros_gz_example_gazebo ros_gz_sim
8 packages not processed

@AllenChienXXX AllenChienXXX added the bug Something isn't working label Oct 25, 2023
@yeagerninja
Copy link

Same issue here with dependencies. Has this been fixed?
OS Version: Ubuntu 22.04 LTS
ROS: Humble
Gazebo: Fortress

Followed template instructions and removed/reinstalled gazebo, but there are dependencies that must not be in the default packages: for example "gz-plugin2"

@YoungRicky7
Copy link

same here, got errors when building
**CMake Error at CMakeLists.txt:13 (find_package):
By not providing "Findgz-cmake3.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"gz-cmake3", but CMake did not find one.

Could not find a package configuration file provided by "gz-cmake3" with
any of the following names:

gz-cmake3Config.cmake
gz-cmake3-config.cmake

Add the installation prefix of "gz-cmake3" to CMAKE_PREFIX_PATH or set
"gz-cmake3_DIR" to a directory containing one of the above files. If
"gz-cmake3" provides a separate development package or SDK, be sure it has
been installed.
**

@Roboticistprogrammer
Copy link

same here, got errors when building **CMake Error at CMakeLists.txt:13 (find_package): By not providing "Findgz-cmake3.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "gz-cmake3", but CMake did not find one.

Could not find a package configuration file provided by "gz-cmake3" with any of the following names:

gz-cmake3Config.cmake
gz-cmake3-config.cmake

Add the installation prefix of "gz-cmake3" to CMAKE_PREFIX_PATH or set "gz-cmake3_DIR" to a directory containing one of the above files. If "gz-cmake3" provides a separate development package or SDK, be sure it has been installed. **

I had this error before it is because you don't have required dependency on your system, you have to install gz-cmake package manually, check https://gazebosim.org/libs/cmake/

@Reka-Berci-Hajnovics
Copy link

Same issue here. I'm running a docker file (FROM osrf/ros:jazzy-desktop-full) and I'm trying to build the template project, but it fails with the following error:

--- stderr: ros_gz_example_gazebo                              
CMake Error at CMakeLists.txt:26 (find_package):
  By not providing "Findgz-sim7.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "gz-sim7", but
  CMake did not find one.

  Could not find a package configuration file provided by "gz-sim7" with any
  of the following names:
    gz-sim7Config.cmake
    gz-sim7-config.cmake
  Add the installation prefix of "gz-sim7" to CMAKE_PREFIX_PATH or set
  "gz-sim7_DIR" to a directory containing one of the above files.  If
  "gz-sim7" provides a separate development package or SDK, be sure it has
  been installed.


---
Failed   <<< ros_gz_example_gazebo [0.42s, exited with code 1]

@Reka-Berci-Hajnovics
Copy link

I have solved the above issue by commenting the following lines in the CMakeLists.txt of ros_gz_example_gazebo:

# Harmonic
#if("$ENV{GZ_VERSION}" STREQUAL "harmonic")
find_package(gz-sim8 REQUIRED)
set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR})
message(STATUS "Compiling against Gazebo Harmonic")
# Default to Garden
#else()
#  find_package(gz-sim7 REQUIRED)
#  set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})
#  message(STATUS "Compiling against Gazebo Garden")
#endif()

Now it is not looking for gz-sim7, and it builds with gz-sim8 by default.

@azeey
Copy link
Contributor

azeey commented Dec 19, 2024

Relates to #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants