How to prevent already defined objects error when linking two statically built libs that use the same header file?
问题 I have several libraries that I want to statically link together. Let's call them Lib1 , Lib2 , Lib3 and Lib4 . Lib4 uses Lib1 and Lib3 ( Lib1 internally uses Lib2 ). I can easily create the DLLs and all work just fine. the issue however is, when I try to build them as static libs I get the already defined objects error which are given bellow. I get these errors when I include Utility.h header file which contains some utility functions that can be used in several libs. For now I am forced to