Allegro 5 initializer element is not constant
Estherial

Hello guys.I am trying to make a paint program with C. Using allegro 5.

#SelectExpand
1#include <allegro5\allegro.h> 2#include <allegro5\allegro_primitives.h> 3#include <allegro5\allegro_image.h> 4ALLEGRO_BITMAP *bmp,*arkaplan,*resim; 5ALLEGRO_DISPLAY *display; 6ALLEGRO_COLOR renk=al_map_rgb(0,0,0); //In this line i had a "initializer element is not constant" error

I can't upload all lines because it's a college project and our lecturer doesn't want a copy paste project. Maybe the people can copy paste it. How can i solve this problem?

Edgar Reynaldo

You can't call allegro functions before main and al_init;

Simply predeclare the color and then assign it later after al_init if you want it to be global.

Estherial

Can you check your inbox please?

Edgar Reynaldo

I replied.

Estherial

I sent another pm. You know why i can't use here. Can you check? Thanks a lot Edgar.

Thread #616585. Printed from Allegro.cc