I am currently developing a system that prevents (that is, practically prohibits) dynamic libraries. Therefore, everything should be connected statically.
The application framework I am using (which cannot be modified) uses the old, statically linked version of the library libfoo.a(version r7). The library I'm using libbarrequires a libfoo.aversion of r8 (in particular, some of the new features are critical for the library to work). I can edit and recompile libbar, as well as libfoor8, but I want to avoid changing them as much as possible, because I am not very good at code (and would have to pass code changes upstream).
Unfortunately, the two libraries libfoohave a significant amount of common characters. Thus, the linker spills out a ton of "multiple character definition" errors.
I heard that you can use objcopyfriends for the "built-in" static library in another. However, I'm not quite sure how to achieve this in practice, and even if this is even the best option.
So, how can I compile an executable file that uses two incompatible versions of the same library? I’ve already thought about avoiding this situation, but it will be much more difficult to work with it.
source
share