Naugrim00
Naugrim00

Reputation: 61

Allegro5: 'al_init':identifier not found

As part of a school project i wanted to use allegro to read the pixels of a png. however im having a problem at the very start of it all. Namely that i am getting errors on pretymuch everything allegro has. the error is that the identifier is not found.

My code:

#include "allegro5/allegro5.h"
#include <iostream>
#include "stdafx.h"

int main(int argc, char** argv)
{
    al_init();

    ALLEGRO_DISPLAY disp = al_create_display(100, 100);

    return 0;
}

The errors i am getting:

the errors

Upvotes: 1

Views: 162

Answers (1)

Naugrim00
Naugrim00

Reputation: 61

So, i figured it out. after moving around the includes i got it to work. tuerns out that stdafx.h needs to be at the top.

Upvotes: 2

Related Questions