#### Archived

This topic is now archived and is closed to further replies.

# allegro causing undefined symbol _main link error

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

## Recommended Posts

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->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;
}


##### Share on other sites
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)

Mark

##### Share on other sites
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)

##### Share on other sites

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]

• 9
• 23
• 10
• 19