Boost::system link error on Ubuntu

不问归期 提交于 2019-12-01 11:45:54

Place all the libraries after all the object files within the command line. The order is important here, unlike on some other operating systems.

You need to (just like n.m earlier wrote) make sure you have the correct order of the linking. Basically some implementations care about what order you link object but also libraries.

If you link a library that hasnt yet been referenced by previous code it will be discarded. I remember coming up with a solution to hack in different (versions of) libraries in a program by referencing the same symbol but in an object linked after the first one and then re-link another library version:

-lyourprojwantingv1 -llibraryofv1 -lyourprojwantingv2 -llibraryofv2

Personally i think this is all just madness! (All of it!)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!