0

I need to include two times a static library ".a" in my code. When I do it, the linker find two times the global variable and the functions.

Is there a way to compile the static library so that can be included two times? Is there a way to link directly all the internal symbols? I can change the name of the external API for both the library.

Antonio
  • 11
  • 2
  • 1
    I'm sorry this doesn't seem to make sense. Why would you need to link twice to the same thing? – Mat May 03 '15 at 07:33
  • You need to rename all non-static symbols, not just function names. Of course much better solution is to rewrite library to use caller-provided state instead of context-unaware global variables. – keltar May 03 '15 at 07:40
  • I have to call a mathematical library in parallel with different input data. Unfurtunately I would not rename all the symbols because they are a lot. Isn't there a tool to do it automatically? – Antonio May 03 '15 at 14:07

0 Answers0