Page 1 of 1

IGraphics->AllocBitMap : dereferencing pointer to incomplete

PostPosted: Tue Dec 11, 2018 1:20 am
by AmiDARK
Hello,

When I use :
displayCore.mainBitMap = IGraphics->AllocBitMap( screenConfig->Width, screenConfig->Height, screenConfig->Depth, BMF_INTERLEAVED, NULL );
I got this error message :
Display.c:169: error: dereferencing pointer to incomplete type
I define in the displayCore :
struct BitMap * mainBitMap;
in screenConfig, Width, Height and Depth are set as ULONG
I don't understand.

Re: IGraphics->AllocBitMap : dereferencing pointer to incomp

PostPosted: Tue Dec 11, 2018 1:40 am
by broadblues
You may have defined them, but the error sugests that the definition has not been included, or possibly there is a typo in the variable declaration, leading to an unknown type

Re: IGraphics->AllocBitMap : dereferencing pointer to incomp

PostPosted: Tue Dec 11, 2018 8:33 am
by Rigo
Have you "included" <proto/graphics.h> ?

Simon

Re: IGraphics->AllocBitMap : dereferencing pointer to incomp

PostPosted: Tue Dec 11, 2018 1:38 pm
by tonyw
@AmiDark:

broadblues wrote:You may have defined them, but the error suggests that the definition has not been included, or possibly there is a typo in the variable declaration, leading to an unknown type


What you included above is a declaration, not a definition. It only declares that a "struct BitMap" is to be stored at that location, without defining what a "struct BitMap" is.

The definition goes along the lines of:

struct BitMap
{
...;
...;
...
};

As Rigo says, it is defined by "including" proto/graphics.h, which in turn defines all the structures you will ever need for graphics.

Re: IGraphics->AllocBitMap : dereferencing pointer to incomp

PostPosted: Tue Dec 11, 2018 5:00 pm
by AmiDARK
Hello everyone and thank you for your answers.

I got wrong because I included <graphics/gfx.h> that contain this definition of BitMap :
struct BitMap
{
UWORD BytesPerRow;
UWORD Rows;
UBYTE Flags;
UBYTE Depth;
UWORD pad;
PLANEPTR Planes[8];
};

I have included <proto/graphics.h> and it solved my issue.
Thank you.

Now I hope my screen/window system will fully work .. Will test it later today.

Regards,
AmiDARK

Re: IGraphics->AllocBitMap : dereferencing pointer to incomp

PostPosted: Tue Dec 11, 2018 7:12 pm
by salass00
In this case it was the definition of the GraphicsIFace structure that was missing that was the problem, hence why IGraphics couldn't be dereferenced to get the AllocBitMap() function.

Including <proto/graphics.h> which in turn includes <interfaces/graphics.h> solved it.

Re: IGraphics->AllocBitMap : dereferencing pointer to incomp

PostPosted: Tue Dec 11, 2018 8:18 pm
by AmiDARK
salass00 wrote:In this case it was the definition of the GraphicsIFace structure that was missing that was the problem, hence why IGraphics couldn't be dereferenced to get the AllocBitMap() function.

Including <proto/graphics.h> which in turn includes <interfaces/graphics.h> solved it.


Will try this.
Thank you.