Return type is an incomplete type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matthoffman
    New Member
    • Dec 2009
    • 2

    Return type is an incomplete type

    Code:
    #include <stdlib.h>
    #include <stdio.h>
    #include <SDL/SDL.h>
    #include <SDL/SDL_ttf.h>
    
    TTF_Font Init_Font()
    {
      TTF_Font *police = NULL;
    
      TTF_Init();
      if(TTF_Init() == -1)
        {
          fprintf(stderr, "Erreur d'initialisation de TTF_Init : %s\n", TTF_GetError());
          exit(EXIT_FAILURE);
        }
    
      police = TTF_OpenFont("Data/lcd.ttf", 15);
      if (police == NULL)
        {
          fprintf(stderr, "Impossible de charger Data/lcd.ttf");
          exit(EXIT_FAILURE);
        }
      else
        return police;
    }
    I just want to initialise a font thanks to SDL_ttf bu can't...
    Thanks for help
  • matthoffman
    New Member
    • Dec 2009
    • 2

    #2
    Omg fixed.
    Simply changed the function into TTF_Font * Init_Font()
    and return NULL instead of exit(EXIT_FAILU RE).
    ;).
    Sorry for disturbing ^^

    Comment

    Working...