Changed everything from c++ to c using a struct the represent GFX objects. Compiles without problem