I have two dynamically loaded libraries lib_smtp.so and libpop.so etc. Both have a global variable called protocol , which is initialized to βSMTPβ and βPOP,β respectively. I have another static library libhttp.a where protocol initialized with "HTTP".
Now for some reason I need to compile all dynamically linked and loadable libraries statically and include in the executable. In doing so, I get a " multiple character definition " error when linking static libraries.
I am curious to know how the linker allows duplicate characters during dynamic linking, where all three of the mentioned libraries are connected?
Is there a way that I can do the same thing statically as the linker executing in the dynamic link, i.e. without any conflict, add all the static libraries to the executable that have the same characters? if not, why is the process different for statically linked libraries.
c linux linker build dynamic-linking
raj_gt1 May 6 '15 at 2:59 p.m. 2015-05-06 14:59
source share