Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing structure definition? #13

Open
ChuckM opened this issue Oct 1, 2024 · 1 comment
Open

Missing structure definition? #13

ChuckM opened this issue Oct 1, 2024 · 1 comment

Comments

@ChuckM
Copy link

ChuckM commented Oct 1, 2024

This seems like it is likely operator error, when I include pngle.h I get a compile time error from the statement

type struct _pngle_t pngle_t;

In the Arduino environment, the esp32 compiler is complaining that struct _pngle_t isn't defined (which it isn't yet as it is defined in the C code).

@kikuchan
Copy link
Owner

kikuchan commented Oct 1, 2024

Thank you for trying to use pngle!

Sorry for confusing, but it's intended.
typedef an incomplete type of struct is a common technique in C.
Such object cannot be instanciated directly.

Instead, please use a pointer to hold a pngle instance, like:
pngle_t *pngle = pngle_new();
and, shouldn't be like:
pngle_t pngle;
or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants