Sign in to follow this  
armahg

Can't load bitmap file using Allegro

Recommended Posts

Hi, This is not a reply. I just started doing some programming with Allegro and C using Dev-Cpp. And I keep receiving this error G:\Games\Bitmapdrawer\Makefile.win [Build Error] [DrawBitmap.exe] Error 1 Here is the log display ----------------------- Compiler: Default compiler Building Makefile: "G:\Games\Bitmapdrawer\Makefile.win" Executing make... make.exe -f "G:\Games\Bitmapdrawer\Makefile.win" all make.exe: Circular bitmap <- bitmap.o dependency dropped. gcc.exe -c bitmap -o bitmap.o -I"C:/Dev-Cpp/include" gcc.exe: bitmap: linker input file unused because linking not done gcc.exe bitmap.o DrawBitmap_private.res -o "DrawBitmap.exe" -L"C:/Dev-Cpp/lib" -mwindows -lalleg gcc.exe: bitmap.o: No such file or directory make.exe: *** [DrawBitmap.exe] Error 1 Execution terminated ------------------------------------------------------------------------- I am using windows Xp and I am not sure if I did the right initial synching of the allegro with Dev-cpp. I am using Game Programmin All in One (2nd Edition) I have managed to run almost all the example allegro files. I had an error when i tried to display a bitmap file... here is the code i used (directly from the book) #include "allegro.h" void main(void) { cahr *filename = "himsalute.jpg"; int colordepth = 32; BITMAP *image; int ret; allegro_init(); intstall_keyboard(); set_color_depth(colordepth); ret = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0,0); if(ret != 0){ allegro_message(allegro_error); return; } //load the image file image = load_bitmap(filename, NULL); if(!image){ allegro_message("Error loading %s", filename); return; } //display the immage blit(image, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); //done drawing-delete bitmap from memory destroy_bitmap(image); //draw font with transparency //text_mode(-1); //display video mode information texprintf(screen, font, 0, 0, makecol(255, 255, 255), "%dx%d %ibpp", SCREEN_W, SCREEN_H, colordepth); //wait for keypress while (!key[KEY_ESC]); //exit program allegro_exit(); } END_OF_MAIN(); ------------------------------------------------------------------------------- Can anyone explain to me what I am doing wrong? I will go ahead doing stuff from the rest of the book. Thanks a million!!

Share this post


Link to post
Share on other sites
Well, your makefile seems to be under the impression you need a bitmap.cpp (or at least a bitmap.o). Which is odd, because your posted code seems independant of anything but Allegro ...

Share this post


Link to post
Share on other sites
Quote:
Original post by armahg
Hi,
This is not a reply. I just started doing some programming with Allegro and C using Dev-Cpp. And I keep receiving this error

G:\Games\Bitmapdrawer\Makefile.win [Build Error] [DrawBitmap.exe] Error 1

Here is the log display
-----------------------
Compiler: Default compiler
Building Makefile: "G:\Games\Bitmapdrawer\Makefile.win"
Executing make...
make.exe -f "G:\Games\Bitmapdrawer\Makefile.win" all
make.exe: Circular bitmap <- bitmap.o dependency dropped.
gcc.exe -c bitmap -o bitmap.o -I"C:/Dev-Cpp/include"
gcc.exe: bitmap: linker input file unused because linking not done
gcc.exe bitmap.o DrawBitmap_private.res -o "DrawBitmap.exe" -L"C:/Dev-Cpp/lib" -mwindows -lalleg
gcc.exe: bitmap.o: No such file or directory
make.exe: *** [DrawBitmap.exe] Error 1
Execution terminated
-------------------------------------------------------------------------

The problem is that the compiler could not generate the bitmap.o file, it seems your source file has no extension, add .c to its name. The linker fails when creating the executable since it doesn't find the bitmap.o file.

[Edited by - GeoMX on July 16, 2006 6:56:02 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this