ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Linker Error in simple program in Groovy

asked 2013-01-07 14:21:21 -0500

Poofjunior gravatar image

Hello, everyone,

I'm having some trouble in the linking step of my program after running rosmake.

My program has a dependency in one other package, though I'm pretty sure that this console output isn't related to something on my end.

[ rosmake ] Last 40 linesmpSensorInterface: 10.4 sec ]                                                                                       [ 1 Active 21/22 Complete ]
{-------------------------------------------------------------------------------
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'virtual thunk to log4cxx::AppenderSkeleton::addRef() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'virtual thunk to log4cxx::helpers::ObjectImpl::~ObjectImpl()'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::Level::getInfo()'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'typeinfo for log4cxx::AppenderSkeleton'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::helpers::ObjectImpl::addRef() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::helpers::Pool::~Pool()'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'typeinfo for log4cxx::Appender'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::Logger::getRootLogger()'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::Logger::getLogger(char const*)'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::AppenderSkeleton::addRef() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::Logger::getLoggerRepository() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'typeinfo for log4cxx::helpers::ObjectImpl'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'VTT for log4cxx::Appender'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::helpers::Object::getClass() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::spi::OptionHandler::getStaticClass()'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::AppenderSkeleton::releaseRef() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::spi::LocationInfo::getLineNumber() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::Logger::getLogger(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::Level::getDebug()'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'vtable for log4cxx::helpers::Object'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::Level::getWarn()'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'virtual thunk to log4cxx::helpers::ObjectImpl::addRef() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::Appender::getClass() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::helpers::ObjectPtrBase::~ObjectPtrBase()'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'virtual thunk to log4cxx::helpers::ObjectImpl::~ObjectImpl()'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'virtual thunk to log4cxx::helpers::ObjectImpl::releaseRef() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::spi::LocationInfo::getMethodName() const'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::AppenderSkeleton::doAppend(log4cxx::helpers::ObjectPtrT<log4cxx::spi::LoggingEvent> const&, log4cxx::helpers::Pool&)'
/opt/ros/groovy/lib/libroscpp.so: error: undefined reference to 'log4cxx::helpers::Object::getStaticClass()'
/opt ...
(more)
edit retag flag offensive close merge delete

Comments

Ah, I should also post my additions to the CMakeLists.txt

19 rosbuild_add_executable(tempSensorInterface src/tempSensorInterface.cpp)

20 target_link_libraries( tempSensorInterface uniserial)

Poofjunior gravatar image Poofjunior  ( 2013-01-07 14:34:49 -0500 )edit

You can also edit your question to add additional information.

joq gravatar image joq  ( 2013-01-08 05:48:13 -0500 )edit

Did you build groovy from source or install the Ubuntu binary packages?

joq gravatar image joq  ( 2013-01-08 05:49:34 -0500 )edit

I'm using the binary packages. Should I remove ROS and reinstall from source? (At this point I've also now successfully installed the log4cxx library.)

Poofjunior gravatar image Poofjunior  ( 2013-01-12 18:37:17 -0500 )edit

The binary packages will be much easier to get working.

joq gravatar image joq  ( 2013-01-13 04:19:09 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2013-01-15 21:53:10 -0500

Dirk Thomas gravatar image

This is a bug in rosconsole. It depends on the log4cxx library but doesn't expose this dependency to downstream projects. For now you have to link against "log4cxx" manually (even you don't use the library yourself). The next release of rosconsole (1.9.40) will fix that.

edit flag offensive delete link more

Comments

interesting, I did not know that, thanks for the heads-up

kalectro gravatar image kalectro  ( 2013-01-16 04:39:17 -0500 )edit

I just discovered this when I removed roscpp from the CMakeLists findpackage() function and was able to create a successful build! Thanks so much for bringing this up! To manually link against log4cxx, right now I'm just adding log4cxx into my target_link_libraries(), or is there a better way?

Poofjunior gravatar image Poofjunior  ( 2013-01-16 23:22:24 -0500 )edit
0

answered 2013-01-08 17:09:01 -0500

kalectro gravatar image

The problem is not that you have too many dependencies declared, it is the opposite. You are missing the log4cxx library which should be installed on a ubuntu workstation, so I guess you are compiling for ARM? Try installing the library by hand and try again

edit flag offensive delete link more

Comments

That makes sense about missing the log4cxx library. I've checked out the latest copy and "sudo make install"ed log4cxx without error now. Alas, though; I'm still getting the same error. Do I need to somehow recompile or update ROS to reflect the new installation of log4cxx?

Poofjunior gravatar image Poofjunior  ( 2013-01-12 18:35:01 -0500 )edit

I think you need to share some more information. Does it compile if you remove your code from the src folder? If yes, please share your code

kalectro gravatar image kalectro  ( 2013-01-12 20:37:37 -0500 )edit

I removed all dependencies in the manifest and ran a Hello World program, which compiled. If I include any dependencies in the manifest, I get the "undefined reference" error from log4cxx. Also: I uninstalled ROS and tried to reinstall from source but got the same error, so I'm back at the binary.

Poofjunior gravatar image Poofjunior  ( 2013-01-13 05:25:12 -0500 )edit

Is there a specific reason why you are using the rosbuild environment and not catkin? Did you set up the rosbuild environment correctly? Did you source it?

kalectro gravatar image kalectro  ( 2013-01-13 17:35:04 -0500 )edit

I haven't yet learned how to use it. After running catkin_make in the directory with the src, I get a successful build, but I don't know where my executables are, and I can't use tab-completion to find them with rosrun <package> <executable> . My package is in a subdirectory of ROS_PACKAGE_PATH

Poofjunior gravatar image Poofjunior  ( 2013-01-14 05:57:58 -0500 )edit

When we want to specify an executable under the catkin_make system, do we still need to add it to the CMakeLists.txt as we did under rosmake? Otherwise, how do we know what name our executable is created under or how to find it? Thanks again for all of your help!

Poofjunior gravatar image Poofjunior  ( 2013-01-14 05:59:44 -0500 )edit

make sure you work through the catkin tutorials. You will have to change a few things to make it compile under catkin. In the tutorial it will also tell you how to set up a rosbuild workspace

kalectro gravatar image kalectro  ( 2013-01-14 07:10:43 -0500 )edit

Thanks very much! I've been able to avoid the error altogether by building under catkin instead!

Poofjunior gravatar image Poofjunior  ( 2013-01-14 17:32:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-01-07 14:21:21 -0500

Seen: 815 times

Last updated: Jan 15 '13