C++ "multiple definitions of"....
Posted: Tue Oct 05, 2010 11:59 am
Each module that includes ImageManager.h will declare a global variable named ImageManager of type class ImageManager.
So main.cpp says: Hey, I've got a global variable named ImageManager, and everyone can muck with it.
And ImageManager.cpp says: Hey, I've got a global variable named ImageManager and everyone can muck with it.
The linker says: Whoa....main and ImageManager both have variables named ImageManager. I can't be sure they are talking about the same thing here, so I'm not going to guess and risk guessing wrong. Barf.
So main.cpp says: Hey, I've got a global variable named ImageManager, and everyone can muck with it.
And ImageManager.cpp says: Hey, I've got a global variable named ImageManager and everyone can muck with it.
The linker says: Whoa....main and ImageManager both have variables named ImageManager. I can't be sure they are talking about the same thing here, so I'm not going to guess and risk guessing wrong. Barf.