allegro causing undefined symbol _main link error

Started by
2 comments, last by vaneger 20 years ago
ive had this before but i dont know what i did to fix it anyone have any ideas ?

#include"SKOFE_COMPONENTS.h"
#include"SKOFE_GUI.h"

int main(void)
{
	allegro_init();             /* initialise the Allegro library */
	install_timer(); // timer init

	install_keyboard(); // keyboard init

	install_mouse(); // mouse init

	install_sound(DIGI_AUTODETECT,MIDI_AUTODETECT,""); // sound init

	set_color_depth(16);                  // sets color depth  

	set_gfx_mode(GFX_DIRECTX_WIN,640,480,0,0); 
	
	EDITOR window;
	window.buffer = create_bitmap(640,480);
	window.AppWindow->headerText = "Dialog header";
	window.AppWindow->myCoords.TL.x = 100;
	window.AppWindow->myCoords.TL.y = 100;
	window.AppWindow->myCoords.BR.x = 200;
	window.AppWindow->myCoords.BR.y = 200;
	
	UTIMER = 0;
	LOCK_VARIABLE (UTIMER);
	LOCK_FUNCTION (Tick);
	install_int (Tick,1);
	
	while(0)
	{
		if(key[KEY_ESC]) break;
		if(UTIMER % 5000 == 0)
		{
			window.update();
			blit(window.buffer,screen,0,0,0,0,640,480);
		}
	}
	allegro_exit();  
	return 0;
}
Advertisement
1. #include <allegro.h>
2. put END_OF_MAIN() after main (this is required on some platforms (including win32) for allegro to correctly wrap main up)
3. Ensure that it''s correctly linked against Allegro for your platform (read docs)

Mark
well ok allegro.h is included in the GUI and COMPONENTS files and also i just forgot to c/p the end_of_main as the last line of the file i posted it IS there in my code. Finally im using msvc++ 6.0 and have alleg.lib included in the link section of project settings.

now can you see why im so confused ?
any other ideas?

(ps sorry for messing up my original post ala missing information)
note to MODERATOR:close this thread

ok im a moron :-\ i made a win console app project instead of a win32 app....i altered my project settings and vola instant linkage.

note to other people who have this same problem:::
read the other posts on allegro on these forums its where i found the anwser to my question.

[edited by - vaneger on April 11, 2004 11:00:53 AM]

This topic is closed to new replies.

Advertisement