Hello, using Eclipse CDT and MinGW compiler am using my old code which compiled in VS2005 to try compile under this new environment but unsuccessfully ... Here are my files
Screen.h
Code:
#ifndef SCREEN_H
#define SCREEN_H
#include <windows.h>
namespace screen
{
void clear_screen ();
void user_wait();
}
#endif
Screen.cpp
Code:
#include "Screen.h"
#ifndef WIN32
#include <unistd.h>
#endif
#ifdef __cplusplus
#include <iostream>
#ifndef WIN32
#include <stdio.h>
#endif
using namespace std;
#else
#include <stdio.h>
#endif
void screen::clear_screen ( void )
{
DWORD n; /* Number of characters written */
DWORD size; /* number of visible characters */
COORD coord = {0}; /* Top left screen position */
CONSOLE_SCREEN_BUFFER_INFO csbi;
/* Get a handle to the console */
HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE );
GetConsoleScreenBufferInfo ( h, &csbi );
/* Find the number of characters to overwrite */
size = csbi.dwSize.X * csbi.dwSize.Y;
/* Overwrite the screen buffer with whitespace */
FillConsoleOutputCharacter ( h, TEXT ( ' ' ), size, coord, &n );
GetConsoleScreenBufferInfo ( h, &csbi );
FillConsoleOutputAttribute ( h, csbi.wAttributes, size, coord, &n );
/* Reset the cursor to the top left position */
SetConsoleCursorPosition ( h, coord );
}
/*
note that the function "pause" already exists in <unistd.h>
so i chose user_wait() for it.
*/
void screen::user_wait()
{
int c;
/* eat up characters until a newline or eof */
do
{
c = getchar();
if(c == EOF) break;
} while(c != '\n');
}
i get 'Screen.h: No such file or directory' but its included under header folder in my project, amongst other files not giving same problem.
Please assist if u can