My problem is simple: I use SDL to create a simple simulation, and I want to store instances of type TTF_Font in smart pointers (shared_ptr), but I keep getting this error:
"incorrectly applying the sizeof parameter to the incomplete type _TTF_Font '"
Is there a way to use smart pointers with incomplete types from external libraries without including their source code in my program?
EDIT:
TTF_Font is declared as
typedef struct _TTF_Font TTF_Font;
_TTF_Font, in turn, is defined in the compiled external library.
My use of TTF_Font is simply to create a new instance with the shared_ptr stack allocated, with a raw pointer to TTF_Font :
auto font_sp = std::shared_ptr<TTF_Font>(font_p);
I do not use explicitly sizeof here.
source share