When creating my small C ++ project, I get the following 2 errors, I can not understand the reason:
error: using typedef-name 'TTF_Font' after 'struct'.
Points to the following line of code: struct TTF_Font;in Foo.h.
error: "TTF_Font" has the previous declaration here.
Points to the following line of code: typedef struct _TTF_Font TTF_Font;in SDL_ttf.h.
I narrowed it down to the following files in a new test project:
foo.h:
#ifndef FOO_H
#define FOO_H
struct TTF_Font;
class Foo
{
TTF_Font* font;
};
#endif
foo.cpp:
#include "Foo.h"
#include "SDL/SDL_ttf.h"
main.cpp:
#include "Foo.h"
int main(int argc, const char* argv[])
{
Foo a;
return 0;
}
Do you guys know what I'm doing wrong?
- TTF_Font, SDL_ttf. , , . , .
struct TTF_Font;, #include "SDL/SDL.ttf.h", . , , , : -).
: IDE Code:: Blocks IDE mingw32. SDL. ++, #.