lucasw / ros_from_src

Build ros from source without using a PPA in a github action. Probably just copy what archlinux is doing. See also https://github.com/ros-o/ros-o
BSD 3-Clause "New" or "Revised" License
102 stars 16 forks source link

compilation error from rosconsole, on ubuntu 22.04 #11

Open youliangtan opened 2 years ago

youliangtan commented 2 years ago

I noticed this repo while trying to install noetic on ubuntu 22.04. However, when first trying out this repo, Iam getting a compilation from rosconsole,error shown as below. This is tested on a fresh new 22.04 PC.

Errors     << rosconsole:make /home/youliang/ros_ws/build/catkin_ws/logs/rosconsole/build.make.002.log                                               
/home/youliang/ros_ws/build/catkin_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp: In function ‘void ros::console::impl::initialize()’:
/home/youliang/ros_ws/build/catkin_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:169:23: error: cannot convert ‘ros::console::impl::ROSConsoleStdioAppender*’ to ‘log4cxx::AppenderPtr’ {aka ‘std::shared_ptr<log4cxx::Appender>’}
  169 |   logger->addAppender(new ROSConsoleStdioAppender);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                       |
      |                       ros::console::impl::ROSConsoleStdioAppender*
In file included from /usr/include/log4cxx/spi/loggingevent.h:28,
                 from /usr/include/log4cxx/layout.h:29,
                 from /usr/include/log4cxx/appenderskeleton.h:28,
                 from /home/youliang/ros_ws/build/catkin_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:42:
/usr/include/log4cxx/logger.h:144:60: note:   initializing argument 1 of ‘virtual void log4cxx::Logger::addAppender(log4cxx::AppenderPtr)’
  144 |                 virtual void addAppender(const AppenderPtr newAppender);
      |                                          ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/home/youliang/ros_ws/build/catkin_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp: In function ‘void* ros::console::impl::getHandle(const string&)’:
/home/youliang/ros_ws/build/catkin_ws/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:203:36: error: cannot convert ‘log4cxx::LoggerPtr’ {aka ‘std::shared_ptr<log4cxx::Logger>’} to ‘void*’ in return
  203 |   return log4cxx::Logger::getLogger(name);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
      |                                    |
youliangtan commented 2 years ago

I manage to fix this compilation error, by replacing the build/catkin_ws/src/rosconsole pkg with your forked version of rosconsole.

https://github.com/lucasw/rosconsole , branch concise_output_roso. I think it will be nice if we can mention this error in the original ros/rosconsole repo, or even open a PR to upstream.

lucasw commented 2 years ago

There is an issue and pr in rosconsole already: https://github.com/ros/rosconsole/issues/50

mgrallos commented 2 years ago

Hi, new to this and I probably don't know what I'm doing 50% of the time. I encountered the same error but I tried replacing the ros/rosconsole folder with the forked version and command the build.sh again but it's still the same.

lucasw commented 2 years ago

I tried replacing the ros/rosconsole folder with the forked version and command the build.sh again but it's still the same.

Was that after doing vcs import --shallow < base_repos.yaml ? That base_repos.yaml already points to the concise_output_roso version.

https://github.com/lucasw/ros_from_src/blob/core/ubuntu_2204/base_repos.yaml#L440-L443

@mgrallos are you building on 22.04 and following this 22.04 readme, and are in the core branch on ros_from_src?