Code: Select all
scrio.h:1:6: error: expected 'while' before 'kprint'
void kprint(const char * msg)
^
scrio.h:1:6: error: expected '(' before 'kprint'
scrio.h:1:13: error: expected primary-expression before 'const'
void kprint(const char * msg)
^
scrio.h:1:29: error: 'kprint' was not declared in this scope
void kprint(const char * msg)
^
scrio.h:2:1: error: expected ')' before '{' token
{
^
scrio.h:2:1: error: expected ';' before '{' token
scrio.h:3:23: error: 'msg' was not declared in this scope
size_t size = strlen(msg);
^
In file included from user.h:4:0,
from os365.h:4,
from kernel.cpp:10:
zbase.h:15:23: error: expected primary-expression before 'width'
window::window(size_t width, size_t height, size_t x, size_t y, const char * caption, const char * text)
^
zbase.h:15:37: error: expected primary-expression before 'height'
window::window(size_t width, size_t height, size_t x, size_t y, const char * caption, const char * text)
^
zbase.h:15:52: error: expected primary-expression before 'x'
window::window(size_t width, size_t height, size_t x, size_t y, const char * caption, const char * text)
^
zbase.h:15:62: error: expected primary-expression before 'y'
window::window(size_t width, size_t height, size_t x, size_t y, const char * caption, const char * text)
^
zbase.h:15:65: error: expected primary-expression before 'const'
window::window(size_t width, size_t height, size_t x, size_t y, const char * caption, const char * text)
^
zbase.h:15:87: error: expected primary-expression before 'const'
window::window(size_t width, size_t height, size_t x, size_t y, const char * caption, const char * text)
^
zbase.h:15:104: warning: cannot call constructor 'gets(word, word)::window::window' directly [-fpermissive]
window::window(size_t width, size_t height, size_t x, size_t y, const char * caption, const char * text)
^
zbase.h:15:104: note: for a function-style cast, remove the redundant '::window'
zbase.h:31:6: warning: type 'gets(word, word)::window' with no linkage used to declare function 'void printw(const char*, gets(word, word)::window)' with linkage [-fpermissive]
void printw(const char * msg, window wnd);
^
zbase.h:32:6: warning: type 'gets(word, word)::window' with no linkage used to declare function 'bool drawObj(gets(word, word)::window)' with linkage [-fpermissive]
bool drawObj(window target);
^
zbase.h:35:1: error: a function-definition is not allowed here before '{' token
{
^
zbase.h:42:1: error: a function-definition is not allowed here before '{' token
{
^
zbase.h:45:16: error: a function-definition is not allowed here before '{' token
void drawmain(){
^
zbase.h:49:42: error: a function-definition is not allowed here before '{' token
void printw(const char * msg, window wnd){
^
kernel.cpp:29:1: error: expected '}' at end of input
}
Code: Select all
//zbase.h
//includes etc...
class window {
public:
size_t width;
size_t height;
size_t x;
size_t y;
const char * caption;
const char * text;
window(size_t width, size_t height, size_t x, size_t y, const char * caption, const char * text);
};
window::window(size_t width, size_t height, size_t x, size_t y, const char * caption, const char * text)
{
this->width=width;
this->height=height;
this->x=x;
this->y=y;
this->caption=caption;
this->text=text;
}
class Widget {
public:
size_t width;
size_t height;
size_t x;
size_t y;
};
void printw(const char * msg, window wnd);
bool drawObj(window target);
void z_init();
bool drawObj(window target)
{
fillRect(target.width,target.height,target.x,target.y,LIGHT_GREY);
fillRect(target.width,16,target.x,target.y,LIGHT_BLUE);
vgaWriteStr(target.x+5,target.y+5,target.caption,LIGHT_GREEN,LIGHT_BLUE);
vgaWriteStr(target.x+5,target.y+21,target.text,MAGENTA,LIGHT_GREY);
}
void delWin(window wnd)
{
fillRect(wnd.width,wnd.height,wnd.x,wnd.y,BLACK);
}
void drawmain(){
vgaWriteStr(0,0,"OS365 Kernel 1.0.2, Z Window System 1.1.0. ",WHITE,LIGHT_BLUE);
vgaWriteStr(0,471,"Press left CTRL to display main menu. ",WHITE,LIGHT_BLUE);
}
void printw(const char * msg, window wnd){
int line_n = 0;
for(int i; i != strlen(msg); i++)
{
if(msg[i] != '\n')
{
vgaPutchar(wnd.x+5+i,wnd.y+21+line_n,msg[i],LIGHT_GREEN,LIGHT_GREY);
}
else
{
line_n++;
}
}
}
//kernel.cpp
//includes etc...
void kernel_main()
{
asm("cli");
setupFonts();
kprint("OS365 Kernel 1.0 is loaded.\nInitializing PIC...",0,0);
init_pics(0x20,0x28);
kprint("\nAll pre-start processes are finished. Preparing to load shell...\n",0,8);
setGraphicsMode();
shellStart();
}
//scrio.h
//includes etc...
void kprint(const char * msg)
{
size_t size = strlen(msg);
for(size_t i = 0; i < size; i++)
{
terminal_putchar(msg[i]);
}
}
And also it got gets from something, but it was in other file.