0

Hi

I am writing a function in C++

extern "C"
{
    __declspec(dllexport) void CreateInputFilter()
    {
        ITestPtr pTest = createInstance<ITest>(m_Test);

    }
}

But I am getting this error

m_Test' : undeclared identifier

The main thing is above this function I have written the same code above in another function but there it is working fine.

Definition of the function is

int cls ::CreateDocument(char* filein, char* fileout, char* config)
{
       ITestPtr pTest = createInstance<ITest>(m_Test);
}

I am not able to understand why the error is coming in the former one.

kindly advice
Regards
Karan

Edited by pyTony: fixed formatting

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by karang
0

m_Test is apparently a member of cls class. CreateInputFilter() is not a member of that class, so it doesn't know what m_Test is.

0

Hi

If I change the definition to

extern "C"
{
__declspec(dllexport) void cls :: CreateInputFilter()
{
ITestPtr pTest = createInstance<ITest>(m_Test);

}
}

I am getting another error

error C2375: 'cls :: CreateInputFilter()' : redefinition; different linkage

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.