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.
IGraphics->AllocBitMap : dereferencing pointer to incomplete
IGraphics->AllocBitMap : dereferencing pointer to incomplete
Sam440EP - AmigaOS 4.1 Final Edition
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: IGraphics->AllocBitMap : dereferencing pointer to incomp
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
Have you "included" <proto/graphics.h> ?
Simon
Simon
- tonyw
- AmigaOS Core Developer
- Posts: 1479
- Joined: Wed Mar 09, 2011 1:36 pm
- Location: Sydney, Australia
Re: IGraphics->AllocBitMap : dereferencing pointer to incomp
@AmiDark:
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.
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.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
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.
cheers
tony
tony
Re: IGraphics->AllocBitMap : dereferencing pointer to incomp
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
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
Last edited by AmiDARK on Tue Dec 11, 2018 7:18 pm, edited 1 time in total.
Sam440EP - AmigaOS 4.1 Final Edition
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: IGraphics->AllocBitMap : dereferencing pointer to incomp
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.
Including <proto/graphics.h> which in turn includes <interfaces/graphics.h> solved it.
Re: IGraphics->AllocBitMap : dereferencing pointer to incomp
Will try this.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.
Thank you.
Sam440EP - AmigaOS 4.1 Final Edition