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

Discussion in 'C++' started by thinktwice, Feb 10, 2006.

  1. thinktwice

    thinktwice Guest

    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.
    thinktwice, Feb 10, 2006
    #1
    1. Advertising

  2. 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
    Victor Bazarov, Feb 10, 2006
    #2
    1. Advertising

  3. thinktwice

    Jim Langston Guest

    "thinktwice" <> wrote in message
    news:...
    > 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?).
    Jim Langston, Feb 10, 2006
    #3
  4. thinktwice

    Daniel T. Guest

    In article <>,
    "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.


    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.
    Daniel T., Feb 10, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roy Yao
    Replies:
    4
    Views:
    371
    Roy Yao
    Aug 21, 2003
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,763
    Smokey Grindel
    Dec 2, 2006
  3. Kobu
    Replies:
    7
    Views:
    449
  4. Phi!
    Replies:
    1
    Views:
    171
  5. Gene Wirchenko
    Replies:
    42
    Views:
    1,407
    Kev Warren
    May 21, 2012
Loading...

Share This Page