Solved:
it wa a problem of where the "include" was included
In the following line i corrected what seemd errors to me
///struct TextAttr Topaz80 = {"topaz.font", 8, 0, 0, }; ///<graphics/text.h> /// variable 'Topaz80' has initializer but incomplete type
into
struct TextAttr Topaz80 = {"topaz.font", 8, '0', '0' }
and later into
struct TextAttr Topaz80 = {
.ta_Name = "topaz.font",
.ta_YSize = 8 ,
.ta_Style = '0' ,
.ta_Flags = '0'
};
for the last i get the errors
guis:Dev/GCView/Def_struct.h:13: error: variable 'Topaz80' has initializer but incomplete type
guis:Dev/GCView/Def_struct.h:14: error: unknown field 'ta_Name' specified in initializer
guis:Dev/GCView/Def_struct.h:14: warning: excess elements in struct initializer
guis:Dev/GCView/Def_struct.h:14: warning: (near initialization for 'Topaz80')
guis:Dev/GCView/Def_struct.h:15: error: unknown field 'ta_YSize' specified in initializer
guis:Dev/GCView/Def_struct.h:15: warning: excess elements in struct initializer
guis:Dev/GCView/Def_struct.h:15: warning: (near initialization for 'Topaz80')
guis:Dev/GCView/Def_struct.h:16: error: unknown field 'ta_Style' specified in initializer
guis:Dev/GCView/Def_struct.h:16: warning: excess elements in struct initializer
guis:Dev/GCView/Def_struct.h:16: warning: (near initialization for 'Topaz80')
I am pretty sure the <graphics/text.h> file is included which states
/****** TextAttr node, matches text attributes in RastPort **********/
struct TextAttr
{
STRPTR ta_Name; /* name of the font */
UWORD ta_YSize; /* height of the font */
UBYTE ta_Style; /* intrinsic font style */
UBYTE ta_Flags; /* font preferences and flags */
};
What can explain the results above ??
Hiow can i test if an 'include' is indeed included?.
TextAttr Solved
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: TextAttr Solved
Code: Select all
struct TextAttr Topaz80 = {
"topaz.font",
8,
FS_NORMAL,
0
};
Make sure that the graphics/text.h file is included before the part where the Topaz80 variable is defined in your code. Ideally all your include commands should be at the top of your source code file before any code (you can have a comment with copyright and such before it though).
In order to check what happens when files are included you can run just the C preprocessor by using the -E command line option:
gcc -E test.c -o preprocessed_test.c
Re: TextAttr Solved
@salass00
Thanks for the explanations.
Thanks for the explanations.