0
$\begingroup$

Rosanswers logo

My question, is there any build or way of compiling ROS from source so that its compiled with libc++ instead of libstdc++? I've reached to compile quite a lot of it with clang,libc++ and c++98 but, there is an error that I don't quite know how to bypass:

/home/ubuntu/ros_catkin_ws/src/ros_comm/rosconsole/src/rosconsole/rosconsole.cpp:428:3: error: use of undeclared identifier 'va_copy'

Bare in mind that I'm only interested in the ROS Barebones of Indigo in this case.

Any idea of how I can bypass this ? Maybe a code susbtitute?

Edit: Thanks for the fast response.

The problem is that I need to import ROS libraries in a system that has been compiled differently. This is an example: In this system when looking for the function ros::NodeHandle it asks for this symbol in the .so:

_ZN3ros10NodeHandleC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_3mapIS7_S7_NS1_4lessIS7_EENS5_INS1_4pairIS8_S7_EEEEEE

But in the ros .so libraries compiled by default, that same function was compiled differently:

_ZN3ros10NodeHandleC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt3mapIS6_S6_St4lessIS6_ESaISt4pairIS7_S6_EEE

THats why it doesnt find it. So maybe I'm trying to compile with a version too old that I really dont need? The only thing I know of the system is that was compiled with libc++ instead of libstdc++. As fas as my limited comprehension goes, we need to compile with clang to be able to use libc++? Or at least for ROS compilation to recognise cxxflags. These are the procedure that I use to compile ROS barebones. am I doing something wrong or could it be changed to make it work?

cd /home/ubuntu/ros_catkin_ws
export CC=/usr/bin/clang-3.9 export
CXX=/usr/bin/clang++-3.9 export
CXXFLGAS="$CXXFLAGS -stdlib=libc++ -std=c++98"
./src/catkin/bin/catkin_make_isolated --install

Any ideas? Am I missing something or overcomplicating stuff? Thanks in advance


Originally posted by RDaneelOlivaw on ROS Answers with karma: 281 on 2017-11-03

Post score: 0


Original comments

Comment by gvdhoorn on 2017-11-04:
Don't use answers unless you are answering your own question. Use comments or edit your original question.

Comment by RDaneelOlivaw on 2017-11-06:
Thanks, I'll bare in mind next time

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

According to https://linux.die.net/man/3/va_copy, va_copy was added in C99. I'm not sure if a compiler in C++98 compatibility mode will expose that macro or not.

According to REP-3, ROS has always targeted C++03, so I suspect there may be some compatibility issues if you're trying to compile with a C++98 compiler. This may only be the tip of the iceberg, and there will probably be more compatibility issues after you get past this one.

If you explain why you want to use a C++ standard that's almost 20 years old, perhaps we can help you find an alternate solution that isn't as invasive.


Originally posted by ahendrix with karma: 47576 on 2017-11-03

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by RDaneelOlivaw on 2017-11-06:
I've edited the question, to make it clear.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.