|
C++, Visual 2008, Allegro 4.2.3, release mode compilation |
qazcde
Member #15,472
January 2014
|
I wanted to compile my program the way I was able to execute it on any computer. Firstly, I changed the runtime library into multi-threaded to include dll libraries. Then I mentioned all the lib file names in additional dependecies. The program started to compile but there was information about a missing alld42.dll file. I copied it to release folder. After that there was a debug error: "This application has requested the Runtime to terminate it in an unusual way". Is there any way to compile in release mode succesfully? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
You should upgrade to 4.4.3. The build system was totally redone to generate solutions with cmake. But to answer your question if it is asking to have alld42.dll then you are linking to a debugging version of allegro. You have to change your linker settings for your project in release mode. There were also numerous bug fixes and a few necessary fixes in the gfx_mode_select* dialogs. 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 |
#00JMP00
Member #14,740
November 2012
|
Is there a possibility to "include"/link the allegro42.dll in the exe-file when compiling? If there is, how is it done?? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
#00JMP00 said: Is there a possibility to "include"/link the allegro42.dll in the exe-file when compiling? If there is, how is it done?? Every dll (dynamic link library) is associated with a *.a archived symbol library or in your case *.lib. That means you are linking to the wrong *.lib (ie, not the one associated with alleg42.dll. You link to a lib file and then run with a dll alongside your exe. 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 |
qazcde
Member #15,472
January 2014
|
Which of the lib files should be mentioned in linker settings? When I include any, the program compiles and runs, but when I click on the exe file, it crashes. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Which lib files did your binary distribution come with? There should be 4 main kinds - dynamic, dynamic debug, static, and static debug. 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 |
qazcde
Member #15,472
January 2014
|
My binary distribution contains the following lib files: alld.lib, alld_s.lib, alleg.lib, alleg_s.lib, alleg_s_crt.lib, allp.lib, allp_s.lib. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Okay he made profiling versions too. The one you want for release mode is alleg.lib. The _s is for static. The d is for debug and the p is for profile. 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 |
qazcde
Member #15,472
January 2014
|
Ok, I performed your tip in project properties. Now the program is compilable and it runs from the IDE, but the exe file still doesn't work. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
If you're running it from the IDE, your working directory might not be what you want it to be when the program runs, corrupting relative paths to files. That would make them fail to load. You can also make a debug build now, with alld.lib. If your program is crashing, you need to debug it. Post your code if that is the case. 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 |
#00JMP00
Member #14,740
November 2012
|
>Edgar Reynaldo: >The one you want for release mode is alleg.lib. The _s is for static. The d is for >debug and the p is for profile. What is the difference between alleg.lib and alleg_s.lib. In terms of executables, both of them should be static??? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
No. alleg.lib is the dynamic archive library for allegro 4. When you link to alleg.lib your program becomes dependent on alleg44.dll or whatever its called. 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 |
qazcde
Member #15,472
January 2014
|
Edgar Reynaldo, I'm not sure what the paths you meant (the library paths or my additional files paths) but you suggested me the right solution! It was a stupid mistake: there weren't files that I used additionally (music, images) in the main directory. What a pity the message box doesn't inform about such an error. Thank you very much for your indispensable help. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
qazcde said: I'm not sure what the paths you meant (the library paths or my additional files paths) but you suggested me the right solution! It was a stupid mistake: there weren't files that I used additionally (music, images) in the main directory. What a pity the message box doesn't inform about such an error. Thank you very much for your indispensable help. Welcome. The paths I was speaking of are the paths to your resources that you are loading in your code. You may find that you have all your resources in place, but it still doesn't load. If that happens the current working directory is most likely wrong, and you would have to change it with : ALLEGRO_PATH* p = al_get_standard_path(ALLEGRO_RESOURCES_PATH); if (!p) {Fail();} al_change_directory(al_path_cstr(p , ALLEGRO_NATIVE_PATH_SEP)); al_destroy_path(p); And the message box won't show up unless you code it to. 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 |
|