MyExe, links to StaticLib1 and StaticLib2. Both static libs compile SomeFile.cpp
Is that a problem? Given that these are static libs? (In DLL world, at least on windows, they are NOT a problem).
Is there an ODR violation? I am confused: one part of me says two copies == problem. The other part says the linker is smart enough to silently discard duplicate copies, and as long as compilation was "same" == no problem. The third part whispers "beware of that silent discard"
If there are problems, then, any remedies short of "tell StaticLib1 and StaticLib2 to NOT compile SomeFile.cpp; compile it separately as part of Exe or as part of a separate lib".
What is SomeFile.cpp in StaticLib1 was coming from zlib version 1.0 and in StaticLib2 was coming from zlib version 2.0? More mayhem? The indeed linker silently discarding one set of symbols and picking up others might be problem.