undeclared identifiers error if #include another .h file! 
Author Message
 undeclared identifiers error if #include another .h file!

Hello

I think this might be a bit of a newbie ATL question.

If I include a .h file get lots of undeclared identifier errors

I am working on an ATL object which handles emailing.  There is class CSmtp
which does most of the clever stuff.  There is a progress function in CSmtp
which calculates the proportion of the email sent.  I ultimately want to
send out a progress event - eg 33%, 66%, 100%.

However, I am having problems calling functions in other classes from CSmtp.
The function I want to call is in send.h.  However, if at the top of
CSmtp.cpp in 'include "send.h" then I get the following six compile errors:

c:\support\io\mail\mailcp.h(6) : error C2065: 'DIID__ISendEvents' :
undeclared identifier
        c:\support\io\mail\mailcp.h(33) : see reference to class template
instantiation 'CProxy_ISendEvents<T>' being compiled
c:\support\io\mail\send.h(14) : error C2065: 'CLSID_Send' : undeclared
identifier
c:\support\io\mail\send.h(17) : error C2065: 'ISend' : undeclared identifier
c:\support\io\mail\send.h(17) : error C2065: 'IID_ISend' : undeclared
identifier
c:\support\io\mail\send.h(17) : error C2065: 'LIBID_MAILLib' : undeclared
identifier
c:\support\io\mail\mailcp.h(7) : fatal error C1903: unable to recover from
previous error(s); stopping compilation
        c:\support\io\mail\stdafx.cpp(0) : see reference to class template
instantiation '<Unknown>' being compiled
Error executing cl.exe.

Mail.dll - 6 error(s), 0 warning(s)

Didn't get these before!  Why is this?  What am I doing wrong?

Angus Comber



Fri, 24 Sep 2004 07:37:52 GMT  
 undeclared identifiers error if #include another .h file!
You need to include a header file generated by MIDL compiler before
"send.h". For your project, it is most likely named as "Mail.h"

HTH,
Vladimir Scherbakov


Quote:
> Hello

> I think this might be a bit of a newbie ATL question.

> If I include a .h file get lots of undeclared identifier errors

> I am working on an ATL object which handles emailing.  There is class
CSmtp
> which does most of the clever stuff.  There is a progress function in
CSmtp
> which calculates the proportion of the email sent.  I ultimately want to
> send out a progress event - eg 33%, 66%, 100%.

> However, I am having problems calling functions in other classes from
CSmtp.
> The function I want to call is in send.h.  However, if at the top of
> CSmtp.cpp in 'include "send.h" then I get the following six compile
errors:

> c:\support\io\mail\mailcp.h(6) : error C2065: 'DIID__ISendEvents' :
> undeclared identifier
>         c:\support\io\mail\mailcp.h(33) : see reference to class template
> instantiation 'CProxy_ISendEvents<T>' being compiled
> c:\support\io\mail\send.h(14) : error C2065: 'CLSID_Send' : undeclared
> identifier
> c:\support\io\mail\send.h(17) : error C2065: 'ISend' : undeclared
identifier
> c:\support\io\mail\send.h(17) : error C2065: 'IID_ISend' : undeclared
> identifier
> c:\support\io\mail\send.h(17) : error C2065: 'LIBID_MAILLib' : undeclared
> identifier
> c:\support\io\mail\mailcp.h(7) : fatal error C1903: unable to recover from
> previous error(s); stopping compilation
>         c:\support\io\mail\stdafx.cpp(0) : see reference to class template
> instantiation '<Unknown>' being compiled
> Error executing cl.exe.

> Mail.dll - 6 error(s), 0 warning(s)

> Didn't get these before!  Why is this?  What am I doing wrong?

> Angus Comber




Sat, 25 Sep 2004 10:58:09 GMT  
 undeclared identifiers error if #include another .h file!
Thank you very much that solved my problem.

If you wouldn't mind.  Could you please explain why mail.h needs to be
included.  And why before send.h?

Angus


Quote:
> You need to include a header file generated by MIDL compiler before
> "send.h". For your project, it is most likely named as "Mail.h"

> HTH,
> Vladimir Scherbakov



> > Hello

> > I think this might be a bit of a newbie ATL question.

> > If I include a .h file get lots of undeclared identifier errors

> > I am working on an ATL object which handles emailing.  There is class
> CSmtp
> > which does most of the clever stuff.  There is a progress function in
> CSmtp
> > which calculates the proportion of the email sent.  I ultimately want to
> > send out a progress event - eg 33%, 66%, 100%.

> > However, I am having problems calling functions in other classes from
> CSmtp.
> > The function I want to call is in send.h.  However, if at the top of
> > CSmtp.cpp in 'include "send.h" then I get the following six compile
> errors:

> > c:\support\io\mail\mailcp.h(6) : error C2065: 'DIID__ISendEvents' :
> > undeclared identifier
> >         c:\support\io\mail\mailcp.h(33) : see reference to class
template
> > instantiation 'CProxy_ISendEvents<T>' being compiled
> > c:\support\io\mail\send.h(14) : error C2065: 'CLSID_Send' : undeclared
> > identifier
> > c:\support\io\mail\send.h(17) : error C2065: 'ISend' : undeclared
> identifier
> > c:\support\io\mail\send.h(17) : error C2065: 'IID_ISend' : undeclared
> > identifier
> > c:\support\io\mail\send.h(17) : error C2065: 'LIBID_MAILLib' :
undeclared
> > identifier
> > c:\support\io\mail\mailcp.h(7) : fatal error C1903: unable to recover
from
> > previous error(s); stopping compilation
> >         c:\support\io\mail\stdafx.cpp(0) : see reference to class
template
> > instantiation '<Unknown>' being compiled
> > Error executing cl.exe.

> > Mail.dll - 6 error(s), 0 warning(s)

> > Didn't get these before!  Why is this?  What am I doing wrong?

> > Angus Comber




Sun, 26 Sep 2004 06:23:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Strange error "undeclared identifier" and HCRYPTPROV

2. error C2065: 'sqrt': undeclared identifier

3. undeclared identifier error

4. error C2065: 'DIID__IMessangerEvents' : undeclared identifier

5. error C2065: DBFILETIME undeclared identifier

6. error C2065: '_com_dispatch_method' : undeclared identifier

7. error C2065: 'sprintf' : undeclared identifier

8. comiper error: undeclared identifier

9. DDX_FieldDateTimeCtrl ....??? Compile error...undeclared identifier

10. 'Undeclared identifier' error

11. error C2065: 'HANDLE' : undeclared identifier

12. error C2065: 'AfxMessageBox' : undeclared identifier

 

 
Powered by phpBB® Forum Software