Jump to content

  • Log In with Google      Sign In   
  • Create Account

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


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
9 replies to this topic

#1 mcgraw   Members   -  Reputation: 560

Like
0Likes
Like

Posted 04 August 2005 - 09:07 PM

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

Sponsor:

#2 AsOne   Members   -  Reputation: 326

Like
0Likes
Like

Posted 07 August 2005 - 01:24 PM

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++.

#3 ZeeRav   Members   -  Reputation: 122

Like
0Likes
Like

Posted 05 May 2006 - 03:23 AM

You have to add the Libs to the compiler Link/input option
alld.lib for debug
alleg.lib for release
allp.lib for profile.


#4 Davy Bartoloni   Members   -  Reputation: 122

Like
0Likes
Like

Posted 16 January 2007 - 11:46 PM

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!

#5 garippe   Members   -  Reputation: 122

Like
0Likes
Like

Posted 17 July 2008 - 10:40 AM

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...

#6 daviangel   Members   -  Reputation: 600

Like
0Likes
Like

Posted 17 July 2008 - 08:24 PM

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.


#7 hispeed   Members   -  Reputation: 122

Like
0Likes
Like

Posted 17 July 2008 - 11:38 PM

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

#8 garippe   Members   -  Reputation: 122

Like
0Likes
Like

Posted 18 July 2008 - 09:28 AM

Warnings have gone but still i have run time error :( : "The application failed to initialize properly (0xc01500002)."


#9 daviangel   Members   -  Reputation: 600

Like
0Likes
Like

Posted 18 July 2008 - 11:32 AM

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?


#10 garippe   Members   -  Reputation: 122

Like
0Likes
Like

Posted 19 July 2008 - 12:56 AM

yes that works.
thank you very much deviangel




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