943,790 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 458
  • C++ RSS
Dec 3rd, 2008
0

m_Test' : undeclared identifier

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Light Poster
karang is offline Offline
46 posts
since Jul 2008
Dec 3rd, 2008
0

Re: m_Test' : undeclared identifier

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,950 posts
since Aug 2005
Dec 3rd, 2008
0

Re: m_Test' : undeclared identifier

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
Reputation Points: 10
Solved Threads: 0
Light Poster
karang is offline Offline
46 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Problem in using dll in another project
Next Thread in C++ Forum Timeline: Simple Craps Game





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC