Load of errors concerning 'console' function.

Started by
3 comments, last by armitroner 11 years, 10 months ago
I was starting on programming my first game ever, a roguelike. I typed out the bare essentials, and I even have the help of a small tutorial, but when I tried to compile this, it gave errors such as:


Symbol 'console' could not be resolved.
Symbol 'true' could not be resolved.
Method 'Clear' could not be resolved.
Method 'Position' could not be resolved.
Program 'make' is not found in PATH.


I'm using the latest Eclipse for Mac OS X.

Here's the program's code:


#include <conio.h>
#include "Console.h"

int main( void )
{
console.Clear();

int nPlayerX=40, nPlayerY=12;

while( true )
{

//Output phase
console.Position( nPlayerX, nPlayerY );
console << '@';

//Input phase
char nKey = getch();

//Processing phase
switch( nKey )
{

//Move down
case 's':
nPlayerY++;
break;

//Move left
case 'a':
nPlayerX--;
break;

//Move right
case 'd':
nPlayerX++;
break;

//Move up
case "w":
nPlayerY--;
break;

//Quit
case 'q':
return 0;
break;

}

}

return 0;

}
Advertisement
The conio.h interface is a very outdated, nonstandard, MS-DOS only console system.

I suspect that whatever tutorial you are using about 15 years out of date.
I see. What would be the latest C/C++ equivalent?
I'm guessing the ncurses library is the closest replacement.

There won't be a direct one-to-one replacement. Much has changed since the days where the entire app was a single text console. Even simple console apps are complicated by the fact that they can potentially co-exist in a windowed world.
Thanks! I'll be researching ncurses and fixing my code.

Rep for you! :)

Edit: Quick thing more... how do I fix my code for ncurses..? :huh:

This topic is closed to new replies.

Advertisement