Re: [AD] Allegro 4.9.20 + MSVS 9

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


OK.. my previous email was difficult to read because I mashed the important symptoms of the problem along with why it was happening and some ideas for how to fix it. The following summary, in bug report format, focuses on the symptoms so Allegro developers can quickly decide if it is worth fixing, first :

[Bug Title:] Allegro 5 demo and examples do not work "out-of-the-box" when built with Visual Studio

[Steps to reproduce:]
1. Build Allegro 5 from source using cmake and Microsoft Visual Studio
2A. Run a5steroids  from Visual Studio via "Start debugging" menu item.
2B. Run a5steroids executable from command prompt
2C. Run any example that loads data from "data" folder (like ex_blit.exe) from command prompt

[Actual results:]
2A. demo momentarily opens window, then closes.
2B. demo momentarily opens window, then closes.
2C. example momentarily opens window, then closes.

[Expected:]
2A. demo runs without automatically closing
2B. demo runs without automatically closing
2C. example runs without automatically closing

[Notes:]
- This will be very frustrating for initial MSVS Allegro 5 users and much effort will be expended in explaining how to work around this issue.
- Even when run from the command line, the executables do not give any indication why they don't run (the printf() messages are not shown in the console.)
- It requires some debugging just to find out why the programs are exiting prematurely
- The examples (but not the demo) *do* work from inside MS Visual studio, so it is even harder to debug why they don't work correctly outside of VS

[Workarounds:]
- Copy/Move executable files from default output directory ("Debug", "Release", etc) to parent directory
- Copy data folders to each configuration directory ("Debug", "Release", etc...)
- Create symlinks to data folder instead copying all data
- Modify source code to use relative addresses and check the parent directory ("..\data\foo.tga")
? Use Path API (I'm not familiar with this API, yet, but it has been suggested)

[Environment]
- Allegro 4.9.20
- MSVC 2008 Express
- Windows 7

Please decide if this is worth fixing, then we can discuss why this happens and how to fix it in more detail.

John

On Fri, Apr 2, 2010 at 2:30 AM, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
On 1 Apr 2010, at 11:55 , John Murphy wrote:
> MSVS places the EXE files in a folder named after the configuration (Debug, Release, etc)
> The demos/examples assume their data folders are at the same level as the EXE file.
> When run from the IDE, this assumption works because the IDE reforms relative paths as if the EXE file were in the parent directory (No "Debug/Release/etc").

I guess you mean that the examples look for the data in the current directory, and the IDE makes sure (by coincidence?) that this works out? I don't know what "the IDE reforms relative paths as if the EXE file were in the parent directory" means otherwise.

> However, the a5steroids demo resource locater uses an absolute path so MSVS does not reform the path; it does not run inside or outside MSVS until the data files are properly located relative to the EXE file.

Well, I guess the demo was written before the path interface was available, so it should probably be updated to make proper use of it. This will have to work "properly" even if the program is not "installed" as a program, though.

> The examples use relative paths, so they work from inside MSVS, but they don't work when run from outside MSVS.

This is a little more tricky. I don't think the examples should use the full path API (unless they're testing the path API, obviously) because that would probably just detract from the rest of the example.

> I can supply patches for the above; however I don't have much experience with the Allegro dev process and git-svn. Also I can only test the MSVC platform.
> Please tell me if you'd like my patches, and how to test/apply them to the SVN repository.

Post your patches to the mainling list and one of us will (hopefully) review them and commit them for you.

Evert
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/