470,863 Members | 1,211 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,863 developers. It's quick & easy.

why does the complier complain undeclare identifier even though i have included the header file?

my project contains tens of files, it compiles well . now i need to add
several class implementation files to the project which are similar
with the classes already exist in
the project, so i add new files and copy the code from the exsited
files(sure need some
modification). but the compiler complains 'classxxx" undeclared
identifier.

Feb 10 '06 #1
3 1286
thinktwice wrote:
my project contains tens of files, it compiles well . now i need to
add several class implementation files to the project which are
similar with the classes already exist in
the project, so i add new files and copy the code from the exsited
files(sure need some
modification). but the compiler complains 'classxxx" undeclared
identifier.


This is covered in the FAQ. See 5.8 and 5.9.

V
--
Please remove capital As from my address when replying by mail
Feb 10 '06 #2
"thinktwice" <me*********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
my project contains tens of files, it compiles well . now i need to add
several class implementation files to the project which are similar
with the classes already exist in
the project, so i add new files and copy the code from the exsited
files(sure need some
modification). but the compiler complains 'classxxx" undeclared
identifier.


Most likely causes are mistyped class names (MyClass instead of myclass for
instance, MyClas for another instance), include files not included where
they should be, improper include guards (did you change the include guards
to match your header and make sure no other header used the same defines?).
Feb 10 '06 #3
In article <11**********************@o13g2000cwo.googlegroups .com>,
"thinktwice" <me*********@gmail.com> wrote:
my project contains tens of files, it compiles well . now i need to add
several class implementation files to the project which are similar
with the classes already exist in
the project, so i add new files and copy the code from the exsited
files(sure need some
modification). but the compiler complains 'classxxx" undeclared
identifier.


It's complaining because you haven't properly declared classxxx in the
context in which it is complaining about. I know that seems pretty
obvious, but there you go.

--
Magic depends on tradition and belief. It does not welcome observation,
nor does it profit by experiment. On the other hand, science is based
on experience; it is open to correction by observation and experiment.
Feb 10 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by aleko | last post: by
15 posts views Thread by Generic Usenet Account | last post: by
14 posts views Thread by Anoop | last post: by
14 posts views Thread by webEater | last post: by
6 posts views Thread by Hemant Shah | last post: by
92 posts views Thread by Heinrich Pumpernickel | last post: by
45 posts views Thread by loudking | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.