Multiple Definition (LNK2005) errors

前端 未结 3 1014
难免孤独
难免孤独 2020-12-12 07:21

I recently tried to create a global header file which would have all definitions of error codes (i.e. NO_ERROR, SDL_SCREEN_FLIP_ERROR, etc.) these would just be integers whi

3条回答
  •  庸人自扰
    2020-12-12 08:10

    You could simply use an enum:

    globals.h:

    enum
    {
        SCREEN_LOAD_ERROR = 1,
        NO_ERROR = 0,
        // ...
    }
    

提交回复
热议问题