rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.66k stars 308 forks source link

undefined reference to spdlog:xxx symbol during build stage #481

Closed YingkunZhou closed 1 year ago

YingkunZhou commented 1 year ago

I use conda install -c conda-forge spdlog to install spdlog dependency, but it seems like that ld cannot find the spdlog library path. The error log is as following:

[ 59%] Linking CXX executable intercept
~/miniforge3/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o: in function `void spdlog::logger::log_<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>(spdlog::source_loc, spdlog::level::level_enum, fmt::v9::basic_string_view<char>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
SessionWrapper.cc:(.text._ZN6spdlog6logger4log_IJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvNS_10source_locENS_5level10level_enumEN3fmt2v917basic_string_viewIcEEDpOT_[_ZN6spdlog6logger4log_IJRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEvNS_10source_locENS_5level10level_enumEN3fmt2v917basic_string_viewIcEEDpOT_]+0x13a): undefined reference to `spdlog::details::log_msg::log_msg(spdlog::source_loc, fmt::v9::basic_string_view<char>, spdlog::level::level_enum, fmt::v9::basic_string_view<char>)'
~/miniforge3/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o: in function `void spdlog::logger::log_<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::filesystem::__cxx11::path, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::filesystem::__cxx11::path> > >&>(spdlog::source_loc, spdlog::level::level_enum, fmt::v9::basic_string_view<char>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::filesystem::__cxx11::path, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::filesystem::__cxx11::path> > >&)':
rizsotto commented 1 year ago

Hey @YingkunZhou , thanks for the report.

This looks like a packaging issue to me. As a developer I can't test every package manager against this project.

Your report is also missing important details about version numbers, OS, etc...