Jump to content
  • Advertisement
Sign in to follow this  
Numb3rz

Debugging Allegro Problem

This topic is 4097 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've just now started back in programming, and decided to give Allegro a shot with VC++ (2005 Express Edition) since I've never worked in VC++ before, but have experience in Allegro. I've got the source code, and debugging error info here for you all to look at, so please look at it, and give me a heads up on what I'm doing incorrect.
#include <stdlib.h>
#include "allegro.h"

int main(void)
{
	//initialize Allegro
	allegro_init();

	//initialize keyboard
	install_keyboard();

	//initialize video mode to 640x480
	int ret = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
	if(ret!=0)
	{
		allegro_message(allegro_eror);
		return 1;
	}
	
	//display screen resolution
	textprintf(screen, font, 0, 0, makecol(255, 255, 255), "%dx%d", SCREEN_W, SCREEN_H);

	//wait for keypress
	while(!key[KEY_ESC]);

	//end the program
	allegro_exit();
	return 0;

}END_OF_MAIN()

and the debug info
------ Build started: Project: Setting Up Allegro, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\program files\microsoft visual studio 8\vc\include\allegro\internal\alconfig.h(397) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\internal\alconfig.h(404) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(421) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(435) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(446) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(460) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(471) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(485) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(521) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned int *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(535) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned int *' of greater size
c:\documents and settings\numb3rz\my documents\allegro projects\setting up allegro\setting up allegro\main.cpp(16) : error C2065: 'allegro_eror' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\Numb3rz\My Documents\Allegro Projects\Setting Up Allegro\Setting Up Allegro\Debug\BuildLog.htm"
Setting Up Allegro - 1 error(s), 10 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'm gettng 1 error and 10 warnings, and I believe in the new version of Allegro 4.2.2 I've reference the alleg.lib correctly in project properties, linkers, additional dependencies, yada ya, but do I only have to reference alleg.lib, or do I have to reference other allegro libs, or have my methods been deprecated to something else I'm not aware of? Please help me. [/source]

Share this post


Link to post
Share on other sites
Advertisement
Well forget the warnings for now... you need to get rid of the error from your code... I've not used allegro, but I guess you meant 'allegro_error' and not 'allegro_eror'. Also is is perhaps a function (ie allegro_message(allegro_error())? Why not try reading the allegro docs as I guess that'll have pretty much exactly this code. Once your code compiles, then you can start worrying about linker options etc... but with an error it never gets to that stage.
Hope this helps,

Dan

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!