Original Post
Hi, I'm using VS.NET to create a static library, 3dLib.lib. This library links to a static math library, MathLib1.lib. I have tried creating a simple console app and linking it to MathLib1.lib in order to test the library. The app works great. However, when I try linking MathLib1.lib to 3dLib.lib I get tons of errors about multiple definitions, similar to: MathLib1.lib(Color.obj) : warning LNK4006: "public: void __thiscall Color::ClampTo01(void)" (?ClampTo01@Color@@QAEXXZ) already defined in MathLib1.lib(Color.obj); second definition ignored My code for 3dLib looks like: dummy.h: #include "../MathLib1/Maths.h" class Dummy { public: Dummy(); ~Dummy(); int x; }; dummy.cpp: #include "dummy.h" Dummy::Dummy() { Vector3 s; //Vector3 is defined in MathLib1.lib s.Set(2,2,2); } Dummy::~Dummy() { } Under Project Properties > Librarian > Additional Dependencies I am specifying MathLib1.lib. Oddly enough, if I remove MathLib1.lib from the dependencies, everything compiles fine. How is possble that the above code compiles, when I don't link with Mathlib1.lib? I would expect the compiler to complain about not having the definition of Vector3::Set( ... ) without linking to the MathLib.