【问题标题】:Issue trying to create an event queue in Allegro 5 C++尝试在 Allegro 5 C++ 中创建事件队列时出现问题
【发布时间】:2021-02-10 12:59:38
【问题描述】:

我正在尝试使用 ALLEGRO_EVENT_QUEUE 在 Allegro 中创建一个事件队列,但我在尝试读取位置 0x0000 时收到了侵权错误。 这是错误消息(它是西班牙语): Excepción no controlada en 0x7BE755AF (allegro-5.0.10-monolith-md.dll) en Geometry World.exe: 0xC0000005: Infraccón de acceso al leer la ubicación 0x00000000。

这些是我的代码中包含的内容

#include

#include

#include

#include

#include

#include

#include

#include

这是出现错误的行中的代码。

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

非常感谢任何帮助

【问题讨论】:

  • 请提取minimal reproducible example 并将其作为您问题的一部分提供。此外,尝试将错误消息转换为未翻译的形式。也可以使用它来搜索网络,尽管在这种情况下它看起来很通用。顺便说一句,还有一个西班牙语 es.stackoverflow.com,以防你感兴趣。作为这里的新用户,也可以使用tour 并阅读How to Ask

标签: c++ allegro allegro5


【解决方案1】:

如果那一行代码就是你所有的代码,那么这里的问题是你没有正确初始化 allegro。

您必须先调用al_init();,然后才能调用任何其他 allegro 函数。

请参阅one of the allegro examples,了解如何正确设置事件队列。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-07
    • 2020-12-11
    • 2011-02-10
    • 2018-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多