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

'CircularBuffer<T, S, IT>::buffer' has incomplete type #46

Closed
MohimenAlMahaini opened this issue Mar 16, 2021 · 2 comments
Closed

'CircularBuffer<T, S, IT>::buffer' has incomplete type #46

MohimenAlMahaini opened this issue Mar 16, 2021 · 2 comments
Labels
waiting-feedback Waiting for feedback from the submitter

Comments

@MohimenAlMahaini
Copy link

In CircularBuffer.h there is a problem with T buffer[s];
'CircularBuffer<T, S, IT>::buffer' has incomplete type

@rlogiacco
Copy link
Owner

This hardly makes any sense.
First of all, take a step back and try the provided examples, verifying if the error is still there.
If the error is not occurring with the examples, please consider double-checking the code producing the error: you should agree it is more probable you did something wrong rather than "there's a problem within the library".
If, after those checks, you are still wondering what's wrong with the use you are making of the library and you are seeking help, you should provide the code which generates such an error along with any detail necessary to reproduce it, like the toolchain you are using for compilation.

By the tiny bit of information you have provided though, I'm 99% convinced you are misusing the library, probably trying to use it as if it is an array.

@rlogiacco rlogiacco added the waiting-feedback Waiting for feedback from the submitter label Mar 17, 2021
@MohimenAlMahaini
Copy link
Author

Sorry probably I'm wrongly implementing the library,

here's the code:

`#include <CircularBuffer.h>

CircularBuffer<struct RX, 15> buf_BAPrx;
CircularBuffer<struct RX, 15> buf_BAPTx;

RX B;

void test()
{
RX B; /* ERORR: incomplete type is not allowed */

}
`
"The code is trying to created an instance of an object on the stack. This object's type is only forward declared but no definition is available to the compiler at that time.

You need to make the definition of this type available to the compiler before it has to create an instance of this type." selalerer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-feedback Waiting for feedback from the submitter
Projects
None yet
Development

No branches or pull requests

2 participants