Jump to content

  • Log In with Google      Sign In   
  • Create Account


Load of errors concerning 'console' function.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 armitroner   Members   -  Reputation: 132

Like
0Likes
Like

Posted 06 June 2012 - 11:12 AM

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;

}


Sponsor:

#2 frob   Moderators   -  Reputation: 20302

Like
1Likes
Like

Posted 06 June 2012 - 11:43 AM

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, 06 June 2012 - 11:44 AM.

Check out my personal indie blog at bryanwagstaff.com.

#3 armitroner   Members   -  Reputation: 132

Like
0Likes
Like

Posted 06 June 2012 - 12:12 PM

I see. What would be the latest C/C++ equivalent?

#4 frob   Moderators   -  Reputation: 20302

Like
1Likes
Like

Posted 06 June 2012 - 02:44 PM

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.
Check out my personal indie blog at bryanwagstaff.com.

#5 armitroner   Members   -  Reputation: 132

Like
0Likes
Like

Posted 06 June 2012 - 03:24 PM

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, 06 June 2012 - 03:30 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS