Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » sorry, unimplemented: non-trivial designated initializers

This thread is locked; no one can reply to it. rss feed Print
sorry, unimplemented: non-trivial designated initializers
AceBlkwell
Member #13,038
July 2011
avatar

All,

I'm following the Vivace tutorial. I made to the ALLEGRO_VERTEX section. I compiled and got this error

.\main.cpp:88:24: sorry, unimplemented: non-trivial designated initializers not supported
};
^
From what I've read this is a g++ issue. I wanted to confirm it wasn't an Allegro issue. I noticed that ALLEGRO_VERTEX struct is has a float u and float v that is not part of the initialization. Could this be the issue? Maybe it can be worked around by initializing them as part of the rest of the initialization process.

#SelectExpand
1 ALLEGRO_VERTEX v[] = { 2 { .x = 210, .y = 320, .z = 0, .color = al_map_rgb_f(1, 0, 0) }, 3 { .x = 330, .y = 320, .z = 0, .color = al_map_rgb_f(0, 1, 0) }, 4 { .x = 210, .y = 420, .z = 0, .color = al_map_rgb_f(0, 0, 1) }, 5 { .x = 330, .y = 420, .z = 0, .color = al_map_rgb_f(1, 1, 0) }, 6 };

The code obviously works or more people would be having a problem with it. I'm guessing it's the operator here.

Any help would be appreciated.

** UPDATE ** I got it to work by removing the variables and leaving the values. I also had to add zeros for the float U and float v.

#SelectExpand
1ALLEGRO_VERTEX v[] = { 2 { 210, 320,0,0,0, al_map_rgb_f(1, 0, 0) }, 3 { 330, 320,0,0,0, al_map_rgb_f(0, 1, 0) }, 4 { 210, 420,0,0,0, al_map_rgb_f(0, 0, 1) }, 5 { 330, 420,0,0,0, al_map_rgb_f(1, 1, 0) }, 6 };

It might not have been the best option but it worked. I can continue on with tutorial. Chime in if there was a better way to handle. Thanks

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: