In article <11*********************@b28g2000cwb.googlegroups. com>,
<ew******@gmail.comwrote:
>I have a header that is shared among different CPP files for constants.
When Microsoft Visual C++ links the .obj files, it complains that these
names are all duplicates. How can I get it to realize that these are
coming from the same header and refer to the same things instead of
making two different copies?
It could be a few things, but sounds like you need extern everywhere
(in the header) except for one place (in one non-header file).
I would suggest getting Stroustrup's The C++ Programming Language
and checking out his Chapter 9. If you don't have this text, get it.
--
Greg Comeau / 20 years of Comeauity! Intel Mac Port now in alpha!
Comeau C/C++ ONLINE ==
http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?