Thread: Problem with Allegro Grabber

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    7

    Question Problem with Allegro Grabber

    Okay, I just started learning about the allegro grabber and am already having problems. I used the grabber to set up a .dat file containing a .bmp and wrote in the code to display the image. When I compiled the program, Dev-C++ gave me no errors. The .dat file and the program are in the same directory. The screen turns black, then it displays the little waiting image for the mouse for a moment, then that goes away, and the computer appears to be working for a minute before windows comes up and tells me my program has encountered an error and had to close. I've tried modifying the image so that it's 8-bit and I've tried it with and without using a palette. Now, I'm thinking that, since I put in a return -1 in case of an error in the program, that could be it, that my program is going through that error process, but it's supposed to display an error message before returning -1, and it's not doing that. Any idea what I've screwed up?

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Perhaps a bit of code might garner a better response.

  3. #3
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    894
    Quote Originally Posted by Nero_Martin View Post
    Dev-C++ gave me no errors.
    What about warnings? Are you using -Wall and -pedantic?

    QuantumPete
    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Perhaps you're getting a segmentation fault or something. Is the BMP image in the same directory? Do you check to see if the file could be opened or not?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  2. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  3. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  4. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 05:18 AM
  5. problem in allegro with sprite leaving trail
    By Leeman_s in forum C++ Programming
    Replies: 18
    Last Post: 09-13-2002, 03:04 PM