Thread: Arrrrrrrrrggggghhhhhhhh

  1. #1
    Arggggh DeepFyre's Avatar
    Join Date
    Sep 2004
    Posts
    227

    Arrrrrrrrrggggghhhhhhhh

    what do i have to do to make this work?!?!?!?
    anyways why do I all of sudden get these 2 errors:

    ../include/conio.c:28: error: `BLACK' was not declared in this scope
    ../include/conio.c:29: error: `LIGHTGRAY' was not declared in this scope
    Keyboard Not Found! Press any key to continue. . .

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Stop using conio? or at least use it right also maybe post some code.
    Woop?

  3. #3
    Arggggh DeepFyre's Avatar
    Join Date
    Sep 2004
    Posts
    227
    what do you mean by "right"?
    and do you want all of the code from conio.c?
    Code:
    static int __BACKGROUND = BLACK;
    static int __FOREGROUND = LIGHTGRAY;
    thats the part thats giving the trouble i think
    Keyboard Not Found! Press any key to continue. . .

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    If your using dev-C++ which i think you are maybe try this place out it has better implementations of conio.h
    http://devpaks.org/list.php?category=Text%20console
    Woop?

  5. #5
    Arggggh DeepFyre's Avatar
    Join Date
    Sep 2004
    Posts
    227
    omg thanks a ton man
    Keyboard Not Found! Press any key to continue. . .

  6. #6
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Exclamation FYI - <conio.h> is non-standard...

    <conio> / <conio.h> is non-standard. (It's not part of the ANSI/ISO C++ language standard.) This means that it's not included with every compiler, and each implimentation of <conio> may be different. That said, it is a psudo-standard and most compilers will have it.

    If you want to change color or shading (or include graphics), you will have to use something non-standard. Anything beyond plain text is non-standard.

    ...maybe post some code.
    prog-bman is asking you to post your code... not conio.c.

    If simply including <conio> caused the errors, then maybe your compiler is configured incorrectly, or maybe this particular <conio> didn't come with your compiler, and isn't compatible with it???

  7. #7
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    conio.h is included in dev-cpp. I use it.


    And if I am correct int only stores a number. Not letters. char stores letters. so you would want' char var_name = "Black" or something like that.

  8. #8
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Quote Originally Posted by Rune Hunter
    And if I am correct int only stores a number. Not letters. char stores letters. so you would want' char var_name = "Black" or something like that.
    Actually, no you wouldn't. Internally conio refers to colors by number. BLACK is simply one of several values stored in an enumeration as shown below:

    Code:
    enum COLORS {
      BLACK,
      BLUE,
      GREEN,
      CYAN,
      RED,
      PURPLE,
      YELLOW,
      WHITE,
      GRAY,
      LIGHTBLUE,
      LIGHTGREEN,
      LIGHTCYAN,
      LIGHTRED,
      LIGHTPURPLE,
      BRIGHTWHITE
    };
    Edit: Silly me. Forgot to name the enumeration.
    Last edited by Frobozz; 09-15-2004 at 02:44 PM.

  9. #9
    Arggggh DeepFyre's Avatar
    Join Date
    Sep 2004
    Posts
    227
    yea i understand the thing about standard/non standard things. for some reason i didnt have that enum colors in conio.h. after prog-bman showedme how to get conio to work i looked at the new source file and the old one and the old one didnt have that enum thing.
    Keyboard Not Found! Press any key to continue. . .

Popular pages Recent additions subscribe to a feed