The project builds on Win32 platform, but not on x64.

Full error message: dllentry.obj : error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)

The dllentry.cpp (a DirectShow base class) compiles on both platforms. It contains the external declarations:

extern CFactoryTemplate g_Templates[];
extern int g_cTemplates;

g_Templates[] is then used in two functions:

__control_entrypoint(DllExport) STDAPI DllGetClassObject(__in REFCLSID rClsID,
__in REFIID riid, __deref_out void **pv)
{
...
for (int i = 0; i < g_cTemplates; i++)
{
const CFactoryTemplate * pT = &g_Templates[i];
}
}

and

DllInitClasses(BOOL bLoading)
{
...
for (int i = 0; i < g_cTemplates; i++)
{
const CFactoryTemplate * pT = &g_Templates[i];
}
}

myClass.cpp contains the definitions for the two externals in dllentry.cpp, at top level, just after the includes:

CFactoryTemplate* g_Templates=0;
int g_cTemplates=0;

myClass.cpp also compiles by itself, but the project does not build. I checked all the libraries in the project settings and all seems to be OK, the 64 bit versions are used.

What should I do to make the project build for x64 platform?