PDA

View Full Version : Compile problem



Jeremy G
11-10-2001, 04:02 PM
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.

Salem
11-10-2001, 04:25 PM
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.

Jeremy G
11-10-2001, 04:36 PM
where can i get such a "real" compiler?

thanks.

doubleanti
11-10-2001, 04:46 PM
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 :)

Salem
11-11-2001, 01:40 AM
The big list
http://www.compilers.net/

doubleanti
11-11-2001, 01:53 AM
oh my......... thank you salem...