Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


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: 22779

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 book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#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: 22779

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 book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#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