0

I'm trying to create an event queue in Allegro using ALLEGRO_EVENT_QUEUE but I get an error of infringement for trying to read a location 0x0000. This is the error message (it's in Spanish): Excepción no controlada en 0x7BE755AF (allegro-5.0.10-monolith-md.dll) en Geometry World.exe: 0xC0000005: Infracción de acceso al leer la ubicación 0x00000000.

These are the includes I have in my code

#include <allegro5/allegro.h>

#include <allegro5/allegro_ttf.h>

#include <allegro5/allegro_font.h>

#include <allegro5/allegro_native_dialog.h>

#include <allegro5/allegro_primitives.h>

#include <allegro5/allegro_image.h>

#include <allegro5/allegro_audio.h>

#include <allegro5/allegro_acodec.h>

This is the code in the line where the error appears.

int main(int argc, char** argv) {ALLEGRO_EVENT_QUEUE* colaEventos = al_create_event_queue();}

Really appreciate any help

CruzSol
  • 1
  • 1
  • Please extract a [mcve] and provide that as part of your question. Further, try to get the error message to its untranslated form. Use that to search the web as well, although it seems pretty generic in this case. BTW, there is also a Spanish es.stackoverflow.com, in case that's interesting for you. As a new user here, also take the [tour] and read [ask]. – Ulrich Eckhardt Oct 28 '20 at 07:28

1 Answers1

0

If that single line of code is all the code you have, then the problem here is that you haven't initialised allegro properly.

You have to call al_init(); first, before you can call any other allegro function.

Refer to one of the allegro examples, to see how you should properly set up a event queue.

amarillion
  • 24,487
  • 15
  • 68
  • 80