[unsolved] Setting up Allegro in Visual C++ 8 (2005 Express Edition)

Started by
8 comments, last by garippe 15 years, 9 months ago
Here I am, attempting to get Allegro to work and while I figured I was -SO- close, I still managed to get an error. -- I went to allegro.cc and downloaded the binary pack for VC7.0 (close enough to my version) -- I copied the files within INCLUDE and LIB over to my VC8 directory. -- I copied the allegro *.dll files (alleg40.dll, alld40.dll, allp40.dll) to my BIN dir in my VC8 Dir. -- I changed to Multithreaded Debug DLL -- I added alld.dll within 'Additional Dependencies' I have a little sample program to test to see if everything worked correctly. /* #define ALLEGRO_STATICLINK */ /* #define USE_CONSOLE */ #include "allegro.h" int main(void) { allegro_init(); allegro_message("Hello World"); return 0; } END_OF_MAIN() ... And here is the beloved output... Linking... MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup Debug\Allegro.exe : fatal error LNK1120: 1 unresolved externals ------------------------------------- I tried to change main(void) to main(int argc, char *argv[]) and I received this error the first time around. The second compile, said the same thing as the previous error. (unresolved external symbol.....)
Compiling...
Newb.cpp
c:\program files\microsoft visual studio 8\vc\include\allegro\internal\alconfig.h(296) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned char *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\internal\alconfig.h(303) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned char *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(251) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned char *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(265) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned char *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(276) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned short *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(290) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned short *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(301) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned short *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(315) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned short *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(351) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned long *' of greater size
c:\program files\microsoft visual studio 8\vc\include\allegro\inline\draw.inl(365) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned long *' of greater size
Linking...
Any help will be extreamly appreciated. Thanks GD'ers
Advertisement
I have had the same problem. In the Beta I Allegro worked, however, in Beta II it does not. I have been told that for Allegro to work in Beta II you must download the Windows Platform SDK (PSDK). You can find a link to download the PSDK on the intro page when you start up VC++.
You have to add the Libs to the compiler Link/input option
alld.lib for debug
alleg.lib for release
allp.lib for profile.
For italian Users for Allegro .h e Visual C++ 2005 express...
(the tutorial is for the English version of Microsoft Visual C++ 2005 Express)

L'altra sera ho perso un po di tempo, a preparare questo breve tutorial, che consente di compilare ed eseguire uno degli esempi forniti con le librerie allegro , utilizzando l'ambiente di sviluppo Microsoft Visual C++ 2005 Express...

capisco che il 90% delle persone che frequenta GPI non ha bisogno di questa guida, ma ho visto troppe volte, della gente abbandonare lo sviluppo con VC++ per colpa dei ripetuti errori del linker... e voglio dare a chi si trova sul punto di abbandonare,la possibilita' di vedere (finalmente) un applicazione compilata e funzionante che includa allegro.h

non mi dilungo oltre, allego il link del tutorial:

http://www.wcn.it/visual%20c++%20express%202005%20con%20allegro%20.h%20by%20Davy%20Bartoloni.htm

... ragazzi, anche se usate DEV-C++ o altri compilatori (e magari odiate Bill) , ricordate sempre che in un curriculum , la voce "Microsoft Visual C++" ci sta' sempre bene.. specialmente in realta' medio-grandi...

Ciao e Buon Lavoro a tutti!
i a new in allegro programming, i install the allegro and compile the code below, compiling was succeeded,but i had 10 warning and so my program crash when i executed it. The crash message was : "The application failed to initialize properly (0xc01500002)."

my program code is:
/* Displaying a bitmap on the screen. */
#include <allegro.h>

int main( void )
{
BITMAP *bmp; /* pointer to the bitmap */

allegro_init(); /* initialize Allegro */
install_keyboard(); /* allow Allegro to recieve keyboard input */
set_color_depth( 16 ); /* set the color depth to 16-bit */
set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0 ); /* set graphics mode */
bmp = load_bitmap( "picture.bmp", NULL ); /* load the bitmap file */
blit( bmp, screen, 0, 0, 0, 0, bmp->w, bmp->h ); /* draw the bitmap */
readkey(); /* wait for a keypress */
destroy_bitmap( bmp ); /* free the memory allocated to bmp */
return 0;
} /* end function main */
END_OF_MAIN() /* Allegro-specific macro */

Warnings are:
------ Build started: Project: alleggro, Configuration: Debug Win32 ------
Compiling...
all.cpp
d:\program files\vc\include\allegro\internal\alconfig.h(397) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
d:\program files\vc\include\allegro\internal\alconfig.h(404) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
d:\program files\vc\include\allegro\inline\draw.inl(421) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
d:\program files\vc\include\allegro\inline\draw.inl(435) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned char *' of greater size
d:\program files\vc\include\allegro\inline\draw.inl(446) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
d:\program files\vc\include\allegro\inline\draw.inl(460) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
d:\program files\vc\include\allegro\inline\draw.inl(471) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
d:\program files\vc\include\allegro\inline\draw.inl(485) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned short *' of greater size
d:\program files\vc\include\allegro\inline\draw.inl(521) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned int *' of greater size
d:\program files\vc\include\allegro\inline\draw.inl(535) : warning C4312: 'type cast' : conversion from 'unsigned int' to 'unsigned int *' of greater size
Linking...
Embedding manifest...
Build log was saved at "file://c:\Documents and Settings\garippe\My Documents\Visual Studio\Projects\directory\Debug\BuildLog.htm"
alleggro - 0 error(s), 10 warning(s)

i have a headache.. i hope your help...
I would tell you to just read the allegro wiki instructions but I guess their server must've finally died since I know not long ago they mentioned the hardware was dying?
Anyways here's the previous my previous post on setting up Allegro that should fix your problems.
setting up Allegro
In particular read aleisterbukowski's blog post since he posted the steps if the wiki is still down.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
I started using Allegro after reading Harbour's Game Programming All in One book, ISBN 1-59200-383-4. Here's a couple of things about Allegro with VC++ from his book.

For VC++, Directx SDK needs to be installed.

Project Settings - Link Tab - Output/Library Modules field needs "alleg.lib" in there. It needs top show up in Project Options field as well.

Make sure the path assigned for the lib is correct.

If you're using a static link, then you have to do a define:
#define ALLEGRO_STATICLINK

Appendix E of the book has detailed install procedures for Allegro with various compilers, it's well worth the price at Amazon.

Hope this helps.
Regards,hispeedxfire: hispeed54
Warnings have gone but still i have run time error :( : "The application failed to initialize properly (0xc01500002)."
Quote:Original post by garippe
Warnings have gone but still i have run time error :( : "The application failed to initialize properly (0xc01500002)."

Did you copy the allegro dll to the same directory as your executable?
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
yes that works.
thank you very much deviangel

This topic is closed to new replies.

Advertisement