ROS Melodic在源码编译的时候,需要log4cxx支持,但是没有可以用pip3,apt-get直接安装的方法,只能编译安装,过程中遇到问题,记录如下:
最开始直接下载最新版:0.12,安装好(安装方法:http://www.360doc.com/content/11/0209/14/116188_91579102.shtml),编译Melodic时,遇到如下错误:
[ 50%] Building CXX object CMakeFiles/rosconsole_log4cxx.dir/src/rosconsole/impl/rosconsole_log4cxx.cpp.o
/data/ros_catkin_full/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp: In function ‘void ros::console::impl::initialize()’:
/data/ros_catkin_full/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:171:50: error: no matching function for call to ‘log4cxx::Logger::addAppender(ros::console::impl::ROSConsoleStdioAppender*)’
logger->addAppender(new ROSConsoleStdioAppender);
^
In file included from /usr/local/include/log4cxx/spi/loggingevent.h:28:0,
from /usr/local/include/log4cxx/layout.h:29,
from /usr/local/include/log4cxx/appenderskeleton.h:28,
from /data/ros_catkin_full/src/rosconsole/src/rosconsole/impl/rosconsole_log4cxx.cpp:42:
/usr/local/include/log4cxx/logger.h:144:16: note: candidate: virtual void log4cxx::Logger::addAppender(log4cxx::AppenderPtr)
virtual void addAppender(const AppenderPtr newAppender);
^~~~~~~~~~~
由于安装的log4cxx版本不对,需要安装0.10.的。
编译0.10的版本时,提示下面的错误(Jetson Xavier NX核心板):
./configure --prefix=/usr/local --with-apr=/usr/local --with-apr-util=/usr/local --with-charset=utf-8 --with-logchar=utf-8 --build=
checking build system type... ./config.guess: unable to guess system type
This script, last modified 2005-08-03, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2005-08-03
根据提示,下载最新的config.guess和config.sub就好了。