gcc does not compile my class......
Posted: Fri Apr 06, 2007 3:36 pm
hi,
i'm using djgpp to compile my os.
i want to code everything with classes.
but gcc doesn't compile one of these classes.
here's the code:
and the error-code is:
thanks
bsunisol
i'm using djgpp to compile my os.
i want to code everything with classes.
but gcc doesn't compile one of these classes.
here's the code:
Code: Select all
#ifndef _VIDEO_H
#define _VIDEO_H
#include "asm.h"
typedef enum _Color {
BLACK, // background and text
BLUE,
GREEN,
CYAN,
RED,
MAGENTA,
BROWN,
WHITE,
DARKGRAY,
BRIGHTBLUE, // only text
BRIGHTGREEN,
BRIGHTCYAN,
PINK,
BRIGHTMAGENTA,
YELLOW,
BRIGHTWHITE
} Color;
class Video { // Video class
public:
Video();
~Video();
void clear();
void write( char *cp );
void put( char c );
void gotoxy( unsigned x, unsigned y );
void SetColour( Color Text, Color Back, bool blink );
unsigned char GetBackColor();
unsigned char GetTextColor();
void SetBackColor( Color col );
void SetTextColor( Color col );
private:
void scrollup() ;
void setcursor( unsigned x, unsigned y );
unsigned short* videomem; //pointer to video memory
unsigned short crtc_mem;
unsigned int ypos; //offset, used like a y cord
unsigned int xpos; //position, used like x cord
unsigned int scrHeight;
unsigned int scrWidth;
unsigned char color; //Text colours
unsigned char text;
unsigned char back;
};
#endif
does anyone know what's wrongvideo.h:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Video'
thanks
bsunisol