hamishd wrote:
TestClass.obj : error LNK2005: "int volatile bIsProcessing"
(?bIsProcessing @@3HC) already defined in OtherClass.obj
Creating library Release/TestDLL.lib and object Release/TestDLL.exp
Release/TestDLL.dll : fatal error LNK1169: one or more multiply
defined symbols found
In TestClass header file I have:
volatile BOOL bIsProcessing;
Never put definitions in the header, unless they are definitions of
functions declared 'inline'. Or definitions of classes. Or of class
templates. Or of function templates. Anyway, do not define *objects*
in headers.
What you probably want is
extern volatile BOOL bIsProcessing; // declaration
in the header and then
volatile BOOL bIsProcessing = false; // definition
in *one* of the C++ files.
In OtherClass I have:
volatile BOOL * pbProcessing;
I cannot link, and I am confused as what is wrong?
The linker already told you: multiple definition of an object.
I can't see any
difference between this situation and one in a different project which
is linking ok
What can I say? Look more carefully. There must be a difference.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask