Hello Thomas
You must use "DefineThreadSafeVar" in one c-file, because this macro
creates the variable. So, use DefineThreadSafeVar in your
multithreading.c file. In the multithreading.h file you use the
DeclareThreadSafeVar, so that you van use the variable in other module too.
Stephan
Thomas McManus schrieb:
> Bilal -
>
> Thanks for the pointers. I read through it and it really seems like
> everything is set up properly.
>
> The problem with the Threading samples is that the Thread Safe
> Variables are created at a global scope within a single file using
> DefineThreadSafeVar(type, name). I'm trying to use the other
> declaration, DeclareThreadSafeVar(type, name), which, according to the
> documentation I've found, should be placed in a head
er that is then
> included in each source file that needs to reference that variables.
>
> I've simplified this down to the following -
>
> multithreading.h -
>
> DeclareThreadSafeVar(int, MyVariable);
>
> multithreading.c
>
> #include
> #include "multithreading.h"
>
> (main, etc here)
> {
> InitializeMyVariable();
>
> return 0;
> }
>
> This results in a linker error for an undefined reference to
> _InitializeMyVariable()
>
> I can't think of what else to add, remove, or change.
>
> Tom McManus