Thread: header stuff getting on nerves

  1. #1

    header stuff getting on nerves

    Why all the sudden am i getting tons of errors? Before i started writing my figiting engone, it was relatively simple to root out bugs in my code. Now, since i am declaring the classes in dofferent header files, i get errors saying:

    34 scenario.h
    `creature' was not declared in this scope
    34 scenario.h
    variable or field `setEnter' declared void


    and

    73 scenario.h
    no `void map::setEnter(...)' member function declared in class `map'


    when it is?

    Has anyone else seen this kind of thing happen? i can't seem to make it get any better no matter what i am doing.
    Compilers:
    GCC on Red Hat 8.1 (Primary)
    GCC on Mac OS X 10.2.4 (Secondary)

    Others:
    MinGW on XP

  2. #2
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    I think you might need to delcare certain things as external ...

    such as if you have an integer in scenarioh.h that you might want to be using in main.h (ficticious name) you would declare it as external

    here's what'd you do for scenario.h

    Code:
    int name;
    now for main.h

    Code:
    #include "scenario.h"
    
    external int name;
    This sounds like the problem you having.

  3. #3
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    i can't really say with out some code...

    you might try the C++ forums, you'll probably get a faster/better answer.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. u_short header?
    By NuNn in forum C Programming
    Replies: 4
    Last Post: 02-19-2009, 12:07 PM
  2. header and source files
    By gtriarhos in forum C Programming
    Replies: 3
    Last Post: 10-02-2005, 03:16 AM
  3. Many Header Files
    By matth in forum C++ Programming
    Replies: 3
    Last Post: 03-08-2005, 02:45 PM
  4. Using c++ standards
    By subdene in forum C++ Programming
    Replies: 4
    Last Post: 06-06-2002, 09:15 AM