Hi!

My linker is giving me a LNK2001 error while building a DLL.

My program looks somewhat like...

I have a DLL project (C1.dll) that contains a sortable list class
CMyList that has a static member variable ... a function pointer ... to
allow me to compare two objects in the list.

Another project I use is the main MFC application (P.exe). Inside this
I have dialogs that use CMyList without any problem.

Unfortunately, I have yet another DLL project (W.dll) that is used by
P.exe and contains dialogs that should ideally use CMyList as well. The
problem I get is that my linker throws a LNK2001 when building W.dll.

To show some code...

--- C1.dll Project ---

- MyList.h -

typedef int (*mylist_CompareFunction) (const int, const CString *,
const CString *); // my compare function type

class CMyList
{
public:
static mylist_CompareFunction m_compareFn; // function pointer
}

- MyList.cpp -

mylist_CompareFunction MyList::m_compareFn; // definition of compare
function

--- P.exe ---

MyListDlg - uses MyList from C1 without any problems

--- W.dll ---

AnotherListDlg - attempts to use MyList also from C1 but cannot -

error LNK2001: unresolved external symbol

Help pls!