Hi everyone,
I'm using Microsoft Visual Studio 2015 Community Edition (C++ code). I have a relatively simple, class template (fully generic, all methods defined inside class declaration, no type specializations) used by multiple projects.
One of my projects compiles only if that project is set to export to a static library. If I make it a dynamic library, the linker complains that the instantiation of the constructor of the aforementioned class template is multiply defined in two .obj files.
Note: the two .obj files contain the method definitions of two classes, one of which is derived from the other (i.e. base.obj and dervied.obj.)
I have tried inlining the constructor but it didn't help. Also, forcing output generates an invalid dll file.
Is this a bug? Is there a setting that I could use to get around this?