Mark wrote:
> I'm trying to write an RAS class on windows ad RasDial's callback
> function requires it to either not be a class member or for it to be
> static. I went for the static option so in the header file I declared an
> extern variable for the class outside of the class definition so I
> could use it in the static function, like so:
>
> #ifndef RasClientH
> #define RasClientH
>
> #include <ras.h>
> #include <raserror.h>
>
> class RasClient
> {
> [snip]
> };
>
> extern RasClient ras;
>
This extern declaration tells the compiler that a global object
with name ras exists. It does not define (instantiate) it.
You do not instantiate it anywhere in the code you showed.
Just add
RasClient ras;
in one of your implementation files. That should solve your linker
problem, but I'm not sure it's really what you want to do.
Stephan
|