delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/04/01:06:31

From: gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug in Allegro? Something strange is happening...
Date: 4 Mar 1997 05:21:06 GMT
Organization: Oxford University
Lines: 48
Message-ID: <5fgbg2$j6u@news.ox.ac.uk>
References: <5fg406$mh5 AT news DOT indy DOT net>
NNTP-Posting-Host: mc31.merton.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Chris Frolik (frolikcc AT indy DOT net) wrote:

: I'm not sure if this will mean anything to anyone, but I hope it does :-)  I 
: am using djgpp, and I compile with the -lm and -lalleg options (my program 
: uses math.h).

The information you posted is much more useful to you if, while it's still
on the screen, you type:

symify c:\gtest\move.exe

This will put function names on the call frame traceback EIPs, making them
mean something to humans. If you also use the -g option on gcc's command
line, it will also put source filenames and line numbers in.

One thing you might check is that the first thing you are doing is an
allegro_init(), or at least that you aren't calling any Allegro functions
before you initialise the library. Also, put a printf("Testing...\n") before
and after the allegro_init(), if that's what you suspect, and put a getch()
after the second printf so that you get to read what it says. Make sure you
put the '\n' at the end - stdout is line-buffered, so you won't see anything
until you write a whole line (or your program terminates). If you see no
`Testing...'s, something is wrong before that stage. If you see only one,
allegro_init() is what is crashing. If you see two, it's nothing to do with
allegro_init().

Alternatively, you could use a debugger to track things more easily.

: I am almost positive that the problem happens somewhere in allegro_init(); 
: The strange thing about this is that it runs fine under Windows 95 but not 
: under DOS. 

Well, this just means that Windows isn't being as sensitive as CWSDPMI to
something. You're probably doing something odd like dereferencing a
pointer before initialising it, or using an Allegro routine before 
initialising that.

: If you would like me to post the source code, I will do that.

If the information above doesn't help you solve the problem, try commenting
out sections out of the code temporarily, until it runs properly, then post
the shortest program that fails, and say which line it fails on (see above).  

Information on Allegro library version might be useful too.

-- 
George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
Merton College, Oxford.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019