-
Notifications
You must be signed in to change notification settings - Fork 72
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
Linker error with libboost-filesystem-mt #103
Comments
Is there anything we can do in mongodb_store or is this due to the static lib? (which has caused us grief elsewhere) |
Dynamic lib would be the easy way out. I'd have to play with a minimal example to see for the static case, but I don't really have time in the next two weeks, sorry! I'll post back when/if I do get something. |
We tried many different things today... no other than the fix @lucasb-eyer and I came up with worked. As @lucasb-eyer says, this ticket is more for documentation purposes. With indigo the problem will be gone, because finally mongoclient is dynamic in trusty. So, I close this for now |
Actually, after a good sleep, no. This happens because the shipped
What currently is Don't have the time to fix it now, but please re-open the issue. |
Not sure I get it (maybe because I'm still sleep deprived). Are you referring to https://github.com/strands-project/mongodb_store/blob/hydro-devel/mongodb_store/cmake/FindMongoDB.cmake shipped with |
Yes, I'm talking about that one. And what I'm saying is that |
Well, from the text (quoted from here)
I conclude that indeed it is correct to have I think I have to agree on that. The problem is that this is only needed IF libmongoclient is static. So, we need to improve this further, I see. Anyone an expert in cmake to make this work as it should? |
The first part is right.
In theory yes, but in practice it doesn't matter since linking to the same dynamic library multiple times is not a problem. I'm sorry I don't have the time to fix it now ; I'm very "deadlined" these weeks, already spent more worktime on this than I should :-/ |
can I assume this is fixed by #105? |
Let's just wait and see. I guess there's a chance I've done something to mess this up. |
I'll try it next week, I'm in an integration week right now. Edit: is it "in" or "on"? |
is fixed, I assume |
I completely lost this from my radar and don't know where to test anymore, sorry. |
TL;DR: move
mongodb_store
to the top of your dependency list.When adding the
mongodb_store
to your CMakeLists.txt, you might be greeted byThe important part being
undefined reference to symbol 'boost::filesystem2::detail::status_api(...)'
. The problem here is that your package is now implicitly linking tolibmongoclient.a
statically. That one needs to call a function defined in the dynamic librarylibboost_filesystem-mt.so
, which is also added to the linker line.BUT if some other dependency of yours also needs
libboost_filesystem-mt.so
, it will be added to the linker line beforelibmongoclient.a
and, for some reason, not added after it again later. For this reason, moving themongodb_store
dependency to the front in your call to catkin'sCOMPONENTS
list fixes that error.Posting this issue for posteriority, aka. google. (And a slight hope for a better fix.)
The text was updated successfully, but these errors were encountered: