![]() |
|
Upgrade from Allegro 5.0.10 to Allegro 5.2.5 |
Steve Silva
Member #16,936
January 2019
|
Hi... I used to programing with Allegro 5.0.10 for about 2 years already and everything was working fine... Now I just noticed that theres a 5.2.5 version and im trying to upgrade by draging the new folders and releasing over the old folders and replacing all the files... but after doing that, when i try to compile my code, i get this error: D:\CodeBlocks\Projetos\Allegro5\steve.h|134|error: 'WIN32_FIND_DATA' was not declared in this scope| Can someone help me how to upgrade from Allegro 5.0.10 to Allegro 5.2.5? Btw im using Code::Blocks IDE (17.12) |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
on first glance it looks like Allegro 525 doesn't include the windows header anymore that would explain why you're missing all those data. Include allegro_windows.h or windows.h . Also don't overwrite the files replace them. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
Edgar Reynaldo THANKS VERYMUCH!!! It worked!!! I just added the windows.h |
Steve Silva
Member #16,936
January 2019
|
Edgar Reynald can you help me again? Well, at fact, yesterday i was hurried up with doing stuffs out of home... So I just tested about compiling my code and it really worked fine (the part about compilation)... I dont even tried to run the .exe on that moment... Today, when I finally got some time, I tried to run my program and I faced with a new problem after upgraded from allegro 5.0.10 to 5.2.5: for some reason, the al_init() not loads... Can you help me from 0? I restored everything here, now i have the allegro 5.0.10 running perfectly... what exactly i need to do for upgrade to 5.2.5? aparently just draging the include folder from the 5.2.5 over the include folder from the 5.0.10 is not working... |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
https://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_and_Allegro_5 That should tell you everything you need to get it fixed up. Basically you change your project's search directories and link options. EDIT 1. How to setup your compiler with CodeBlocks : https://www.allegro.cc/files/attachment/612115 If you install to c:\mingw, then it should auto detect it as well. Second, you don't link to every version of the allegro library, only the one you need. Third, you need to compile as C++11 to get to_string and stoi. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
Well, im almost there... I made the codeblocks recognize the compiler and i removed ALL the linker tags and I just leave these ones: -lallegro_monolith.dll Now it compiles without any error, BUT the al_init() returns 0... BTW heres the sample code: 1#include <cstdio>
2#include <allegro5/allegro.h>
3#include <allegro5/allegro_primitives.h>
4#include "allegro5/allegro_image.h"
5
6int main() {
7 al_init();
8 al_init_primitives_addon();
9 al_init_image_addon();
10 al_install_keyboard();
11 ALLEGRO_DISPLAY *display=al_create_display(400,225);
12 ALLEGRO_KEYBOARD_STATE keystate;
13 al_set_window_position(display,0,0);
14 al_get_keyboard_state(&keystate);
15 al_set_target_backbuffer(display);
16 al_draw_filled_rectangle(0,0,400,225,al_map_rgb(0,200,0));
17 al_draw_filled_triangle(20,117.5,200,20,380,117.5,al_map_rgb(255,255,0));
18 al_draw_filled_triangle(20,117.5,200,205,380,117.5,al_map_rgb(255,255,0));
19 al_draw_filled_circle(200,117.5,50,al_map_rgb(0,0,255));
20 al_wait_for_vsync();
21 al_flip_display();
22 while(!al_key_down(&keystate,59)) al_get_keyboard_state(&keystate);
23 al_uninstall_system();
24 return 0;
25}
|
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Now delete the old dlls you were using for 5.0.10 and replace them with the ones that come in the /bin/dlls folder in the distro. If that still doesn't work, you're compiling against the wrong headers. Make sure you fixed your include path for the compiler. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
OMG... Finally!!! I did what you told about deleting old dlls But i had to do 2 extra-things: and i needed also to copy the libdumb.dll to Thanks verymuch for all the help!!! Edit: I got a new problem (the test i did was with the sample code, and everything worked, BUT... the sample code uses only allegro stuffs... My main code uses PhysFS and for now i got this error (not when trying to compile, and even not on the fly, when running it just get error on loading the .exe I needed to debug it to find the error, and the error is this: Why its searching the Physfs on that folder???? I even not added any folder on codeblocks setup like that, the only thing i used to do is doing a #include with the correct folder where the PhysFS are... how to change this location without needing to CREATE that strange folder just to move my PhysFS to there?) Edit2: I created that folder on C:\ and moved my PhysFS files to there... now i got a new error (that i need to debug also to find it) there: |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Steve Silva said: C:\LIBS5303Build\physfs-2.0.3\physfs.c: No such file or directory. That is really old. Where did you download that from? These are the binaries : and they go with the compiler I pointed out here : You don't need physfs.c, or any .c file. Use the libs like normal. You shouldn't have to compile anything, only link it. Either your project is messed up, or you downloaded the wrong thing. Also, don't copy .dll files to your system folders. They don't belong there. Leave them next to your executable file. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
Edgar Reynaldo said: That is really old. Where did you download that from? I downloaded both MinGW and A5.2.5 from a link posted from you in anywhere i just dont remember where... But ok, ill download again, these ones you posted right now and ill try again, ill come back later to tell you if it worked or not... |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
MinGW 5.3.0.3 is from like 10 years ago... My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
Im back, i recorded a very short video (its about 1 min) to show you all the configs, the code im trying to run (its just a sample, but uses both allegro and physfs) OFC using your new files |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Okay, things I saw. 1) You don't need to link to libgdi32.a unless you're linking statically. 2) Link to libphysfs.dll (-lphysfs.dll) . 3) You're still compiling against an old version of allegro. Otherwise it wouldn't be looking for the source in LIBS5303Build. If you installed an old version of allegro it must be removed, especially if it's in c:\mingw\bin and c:\mingw\include. I tested a PHYSFS example with the same binaries and same compiler you're using and it works fine. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
I swear i fully deleted both MinGW and Allegro folders BEFORE extracting your ones dude... But ok, the only thing left to test is about: 1) You don't need to link to libgdi32.a unless you're linking statically. Edit: WOW!!! Really these 2 last steps fixed the problem and now even my main code is running fine!!! Thanks very much!!! Specially for your great patience!!! I hope this post can help all people who have the same problem (upgrading from 5.0.10 to 5.2.5) =) |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
When your exe crashes, could you type 'bt' and post the results? You must have been linking to an old version of PHYSFS. That is the only thing that could explain it. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
As i told before, everything is working fine for now just doing the steps 1 and 2... Thanks again =)))))))) Edit: Just to tell you, my PhysFS was downloaded from there |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
I provided PhysFS along with allegro. That version of physfs is older. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
Oh nice, I just tested it right now... Its there, thanks... |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
From https://liballeg.org/a5docs/trunk/physfs.html#al_set_physfs_file_interface : Quote: This function sets both the ALLEGRO_FILE_INTERFACE and ALLEGRO_FS_INTERFACE for the calling thread. Which means you need to call both ; https://liballeg.org/a5docs/trunk/file.html#al_set_standard_file_interface and https://liballeg.org/a5docs/trunk/fshook.html#al_set_standard_fs_interface to restore the normal disk function. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Steve Silva
Member #16,936
January 2019
|
Thanks verymuch!!! you are a great person =))) |
|