Hi,
I have problem on linking an extern variable.

My code is look like as follows.

My dll contains the following code

DllTest.h
-----------

#include <iostream>

namespace Test
{
__declspec(dllexport) extern int* i;
}

DllTest.cpp
--------------

#include "DllTest.h"

namespace Test
{
__declspec(dllexport) int *i = NULL;
}

If i make a dll with above code it is done.
When i am linking this dll with my Test program it gives the error
error LNK2001: unresolved external symbol "int * Test::i" (?i@Test@@3PAHA)

My Test Program for this dll is

#include <DllTest.h>

void main()
{
if (Test::i == NULL)
{
printf("Null");
}
else
{
printf("Not Null");
}
}

If anybody gives solution i am very much happy......
thanks in advance

Regards
Manikandan