Skip to content

rcl_logging_spdlog breaks the build under libc++ #34

@rotu

Description

@rotu

Similar to #14, compilation fails in the linking phase when building with the Clang option -stdlib=libc++.

Ubuntu Focal / Clang 11

Starting >>> rcl
--- stderr: rcl                                       
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::flush_()
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::sink_it_(spdlog::details::log_msg const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::basic_file_sink(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern_(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter_(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::log(spdlog::details::log_msg const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::flush()
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::logger::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, spdlog::pattern_time_type)
ld.lld: error: ld.lld: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::flush_()
error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::flush_()
ld.lld: error: ld.lld: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::sink_it_(spdlog::details::log_msg const&)
error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::sink_it_(spdlog::details::log_msg const&)ld.lld
: ld.llderror: : /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::basic_file_sink(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)error: 
/opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::basic_file_sink(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)
ld.lldld.lld: : error: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)/opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)

ld.lldld.lld: : error: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern_(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)/opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern_(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)

ld.lldld.lld: : error: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)/opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)

ld.lld: ld.llderror: : /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter_(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)error: 
/opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter_(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)ld.lld
: ld.llderror: : /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::log(spdlog::details::log_msg const&)error: 
/opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::log(spdlog::details::log_msg const&)ld.lld
: ld.lld: error: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::flush()
/opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::flush()ld.lld
: ld.llderror: : /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::logger::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, spdlog::pattern_time_type)error: 
/opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::logger::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, spdlog::pattern_time_type)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::flush_()
clangld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::sink_it_(spdlog::details::log_msg const&): 
error: linker command failed with exit code 1 (use -v to see invocation)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::basic_file_sink(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern_(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter_(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::log(spdlog::details::log_msg const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::flush()
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::logger::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, spdlog::pattern_time_type)
make[2]: *** [test/CMakeFiles/client_fixture__rmw_fastrtps_dynamic_cpp.dir/build.make:150: test/client_fixture__rmw_fastrtps_dynamic_cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:362: test/CMakeFiles/client_fixture__rmw_fastrtps_dynamic_cpp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test/CMakeFiles/test_security.dir/build.make:114: test/test_security] Error 1
make[1]: *** [CMakeFiles/Makefile2:306: test/CMakeFiles/test_security.dir/all] Error 2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test/CMakeFiles/test_validate_topic_name.dir/build.make:111: test/test_validate_topic_name] Error 1
make[1]: *** [CMakeFiles/Makefile2:335: test/CMakeFiles/test_validate_topic_name.dir/all] Error 2
make[2]: *** [test/CMakeFiles/service_fixture__rmw_fastrtps_dynamic_cpp.dir/build.make:150: test/service_fixture__rmw_fastrtps_dynamic_cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:389: test/CMakeFiles/service_fixture__rmw_fastrtps_dynamic_cpp.dir/all] Error 2
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::flush_()
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::sink_it_(spdlog::details::log_msg const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::basic_file_sink(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern_(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter_(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::log(spdlog::details::log_msg const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::flush()
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::logger::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, spdlog::pattern_time_type)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test/CMakeFiles/test_timer__rmw_fastrtps_dynamic_cpp.dir/build.make:114: test/test_timer__rmw_fastrtps_dynamic_cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:447: test/CMakeFiles/test_timer__rmw_fastrtps_dynamic_cpp.dir/all] Error 2
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::flush_()
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::sink_it_(spdlog::details::log_msg const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::basic_file_sink<std::__1::mutex>::basic_file_sink(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_pattern_(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::set_formatter_(std::__1::unique_ptr<spdlog::formatter, std::__1::default_delete<spdlog::formatter> >)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::log(spdlog::details::log_msg const&)
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::sinks::base_sink<std::__1::mutex>::flush()
ld.lld: error: /opt/ros/master/install/lib/librcl_logging_spdlog.so: undefined reference to spdlog::logger::set_pattern(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, spdlog::pattern_time_type)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test/CMakeFiles/test_namespace__rmw_fastrtps_dynamic_cpp.dir/build.make:152: test/test_namespace__rmw_fastrtps_dynamic_cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:418: test/CMakeFiles/test_namespace__rmw_fastrtps_dynamic_cpp.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< rcl	[ Exited with code 2 ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions