m_Test' : undeclared identifier

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 46
Reputation: karang is an unknown quantity at this point 
Solved Threads: 0
karang karang is offline Offline
Light Poster

m_Test' : undeclared identifier

 
0
  #1
Dec 3rd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,343
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1458
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: m_Test' : undeclared identifier

 
0
  #2
Dec 3rd, 2008
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 46
Reputation: karang is an unknown quantity at this point 
Solved Threads: 0
karang karang is offline Offline
Light Poster

Re: m_Test' : undeclared identifier

 
0
  #3
Dec 3rd, 2008
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC