Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with linking libraries #7

Open
JonasRSV opened this issue Oct 2, 2020 · 4 comments
Open

Problem with linking libraries #7

JonasRSV opened this issue Oct 2, 2020 · 4 comments

Comments

@JonasRSV
Copy link

JonasRSV commented Oct 2, 2020

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?

@jpieper
Copy link
Member

jpieper commented Oct 2, 2020

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?

@JonasRSV
Copy link
Author

JonasRSV commented Oct 2, 2020

Maybe, would the stdlib have to be added for every library?

@jpieper
Copy link
Member

jpieper commented Oct 2, 2020

Nope, only for binaries.

@JonasRSV
Copy link
Author

JonasRSV commented Oct 2, 2020

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! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants