Compile problem

This is a discussion on Compile problem within the A Brief History of Cprogramming.com forums, part of the Community Boards category; error C4226: nonstandard extension used : 'far' is an obsolete keyword d:\program files\microsoft visual studio\myprojects\testarea\main.cpp(31) : error C2079: 'r' uses ...

  1. #1
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704

    Compile problem

    error C4226: nonstandard extension used : 'far' is an obsolete keyword
    d:\program files\microsoft visual studio\myprojects\testarea\main.cpp(31) : error C2079: 'r' uses undefined union 'REGS'


    When ever i try to use union REGS in my code it flags an error. is there a certain file i have to include or bad code??
    void VGAScreen ()
    {
    union REGS r;
    r.h.ah = 0;
    r.h.al = 0x13;
    int86(0x10, &r, &r);
    }

    //This resets the display to text mode
    void TextScreen ()
    {
    union REGS r;
    r.h.ah = 0;
    r.h.al = 0x3;
    int86(0x10, &r, &r);
    }

    Thanks.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,490
    vc++ is NOT a DOS compiler - it is a windows and console (win32) compiler.

    > error C4226: nonstandard extension used : 'far' is an obsolete keyword
    There are no near and far pointers in 32 bit systems - all pointers are 32 bits.

    > d:\program files\microsoft visual studio\myprojects\testarea\main.cpp(31) : error C2079: 'r' uses undefined union 'REGS'
    Since you can't call int86 from either windows or console mode programs, this is undeclared.

    > is there a certain file i have to include or bad code??
    Not necessarily bad, just inappropriate for your compiler and operating system.

    You need a real DOS compiler, running real DOS to make this work as you intend.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    where can i get such a "real" compiler?

    thanks.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  4. #4
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    i think they have one at borland.com don't they? TCv2.0 right? that, and you can always use DJGPP... www.delorie.com/djgpp
    hasafraggin shizigishin oppashigger...

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,490
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    oh my......... thank you salem...
    hasafraggin shizigishin oppashigger...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 09-14-2008, 02:35 PM
  2. compile problem
    By chintugavali in forum C++ Programming
    Replies: 3
    Last Post: 02-20-2008, 11:16 PM
  3. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  4. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  5. size of Object c++ compile problem
    By micha_mondeli in forum C++ Programming
    Replies: 5
    Last Post: 04-06-2005, 01:20 PM

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