Problem with linking libraries
JonasRSV opened this issue · 4 comments
Hey, I think this tool is awesome, and I would love to use it.
But I have a small problem, so I have this moderately big c++ project and using this to compile all of my individual libraries works, but when I try to link everything to the main binary I get over 100x undefined symbol errors,
e.g:
ld.lld: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()
Do you have any clue what could be the cause of this? and how to adress it?
When this was originally made bazel didn't really support transitions between C++ toolchains very well, and it does a tiny bit more now but still not in a way that is easy for rule writers. Because of this, you need to manually link against the C++ standard library. See the example:
https://github.com/mjbots/rpi_bazel/blob/master/example/BUILD#L20
Does that help?
Maybe, would the stdlib have to be added for every library?
Nope, only for binaries.
I will try it at a later point, I deleted my arm alsa dynamic library, but I referenced this in an issue, i you don't like having this issue open I don't mind you closing it and I can re-open if it doesn't work.
Thanks for the help! :)