473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

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 1375
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Roy Yao | last post by:
Why the following code let my compiler complain an overloaded function Init()? // code begin template<class T> class BicircularList { template<class T> class Iterator; template<class T> class...
11
by: aleko | last post by:
This applies equally to function prototypes. Why do we have to tell the compiler twice? Other modern compiled languages don't have this requirement. Just curious, Aleko
15
by: Generic Usenet Account | last post by:
While I have a very good feel for how inlining works, I fail to see how in the world inlining can work if the inlined function is not described "in place" in a header file, but rather defined in a...
4
by: Stephen Corey | last post by:
I've got 2 classes in 2 seperate header files, but within the same namespace. If I use a line like: // This code is inside Class2's header file Class1 *newitem = new Class1(param1, param2); ...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
14
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src=""...
6
by: Hemant Shah | last post by:
Folks, Today, I was exporting a table in one database and then importing it in another database. The table in destination database was missing one column (my mistake while creating the table),...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
45
by: loudking | last post by:
Hello, all I don't quite understand what does ((time_t)-1) mean when I execute "man 2 time" RETURN VALUE On success, the value of time in seconds since the Epoch is retu rned. On error,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.