Skip to main content
GameDev.net gamedev.net
🔒 Locked

Load of errors concerning 'console' function.

Started by armitroner Jun 6, 2012 at 5:12 PM 3 replies 1.3k views
Original Post
armitroner
armitroner
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;

}
frob
frob
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.
armitroner
armitroner
I see. What would be the latest C/C++ equivalent?
frob
frob
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.
armitroner
armitroner
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..?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.