Can't enumerate 'FAR' ??

This is a discussion on Can't enumerate 'FAR' ?? within the C++ Programming forums, part of the General Programming Boards category; the first enum declaration gives me a bunch of errors, when i take 'FAR' out it works fine, why is ...

  1. #1
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640

    Can't enumerate 'FAR' ??

    the first enum declaration gives me a bunch of errors, when i take 'FAR' out it works fine, why is this?

    Code:
    // this doesnt compile
    enum PLANE {RIGHT, LEFT, BOTTOM, TOP, FAR, NEAR};
    
    // this does
    enum PLANE {RIGHT, LEFT, BOTTOM, TOP, BACK, NEAR};
    edit: btw, VC++ 6.0,

  2. #2
    Open to suggestions Brighteyes's Avatar
    Join Date
    Mar 2003
    Posts
    204
    Would you happen to include windows.h in your program? FAR is defined for another purpose in that header and you would almost certainly cause a naming collision by trying to redefine it.

  3. #3
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Originally posted by Brighteyes
    Would you happen to include windows.h in your program? FAR is defined for another purpose in that header and you would almost certainly cause a naming collision by trying to redefine it.
    yup, that sounds about right. i wasnt sure which included library i might be conflicting with. must be windoors.h, oh well. 'BACK' will do just fine

    thnx for the reply!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Enumerate all
    By geek@02 in forum Windows Programming
    Replies: 7
    Last Post: 06-14-2004, 05:57 PM
  2. [code] Enumerate IE instances and retrieve interfaces.
    By anonytmouse in forum Windows Programming
    Replies: 1
    Last Post: 05-05-2004, 08:01 AM
  3. Enumerate ALL CD-drives
    By Steph in forum Windows Programming
    Replies: 3
    Last Post: 06-04-2003, 12:24 AM
  4. Enumerate type
    By dv007 in forum C Programming
    Replies: 8
    Last Post: 07-15-2002, 03:32 PM
  5. Replies: 1
    Last Post: 05-28-2002, 11:20 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21