Jump to content
  • Advertisement
Sign in to follow this  

Load of errors concerning 'console' function.

This topic is 2175 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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;

}

Share this post


Link to post
Share on other sites
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. Edited by frob

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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: Edited by X3H

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!