hi everybody!

I am trap in a problem related to structure.

I am working in the project in which I am devleoping a DLL in C++

using VC++ editor.

The code I am using is as follow:

//This is header file 
typedef struct{

  static char szOriginalAddress[0x100];
   static char szRecipientAddress[0x100];
   static char szFileName[0x100];

} TExternalFilter;

     
// Insert your headers here
#define WIN32_LEAN_AND_MEAN        // Exclude rarely-used stuff from Windows headers
#include <iostream>
#include<stdio.h>
#include <string>
#include <conio.h>

#import "C:\Program Files\Common Files\System\ADO\msado15.dll"\
no_namespace rename ("EOF", "ADOEOF")

////EXPORT DWORD MerakFilterProc(TExternalFilter* );

//This is the program in which the above header file is included

EXPORT DWORD MerakFilterProc(TExternalFilter* ExternalFilter)
{        
    static char temp[256];    
    strcpy(temp,ExternalFilter->szOriginalAddress);//linker error
    string to = temp;    
.........
  }

//This CPP file is called by our Main CPP program

when I run this code then a Linker error is gemerated which is as

follow :

error LNK2001: unresolved external symbol "public: static char * __unnamed::szOriginalAddress"
(?szOriginalAddress@__unnamed@@2PADA)

This problem is due to the static members of the structure.But I have

to use these static members.

How can declare and define these static members variables ?The

linker error may be due to static variables not being defined but

only declared.

Please help me solving my problem.

Thanks in advanced.

Bhagwat

What about the answers here?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.