Error Field Has Incomplete Type Enum
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn error field has incomplete type struct more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
C++ Error Field Has Incomplete Type
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like
Error Field St_atim Has Incomplete Type
you, helping each other. Join them; it only takes a minute: Sign up Field 'permission_type' has incomplete type up vote 1 down vote favorite When I try to compile one I get this error: In file included from
Error Field Info Has Incomplete Type
arch/arm/mach-msm/board-htcleo.c:81:0: include/linux/ion.h:192:27: error: field 'permission_type' has incomplete type How can I solve this problem? My code is as follows: struct ion_cp_heap_pdata { enum ion_permission_type permission_type; unsigned int align; ion_phys_addr_t secure_base; /* Base addr used when heap is shared */ size_t secure_size; /* Size used for securing heap when heap is shared*/ int reusable; int mem_is_fmem; enum ion_fixed_position fixed_position; int iommu_map_all; int iommu_2x_map_domain; ion_virt_addr_t *virt_addr; int (*request_region)(void *); int (*release_region)(void *); void *(*setup_region)(void); }; c share|improve this field has incomplete type array question edited Aug 7 '13 at 14:20 Fred Foo 228k34429605 asked Aug 7 '13 at 13:48 user2660959 61 3 Make sure enum ion_permission_type is defined before the struct declaration. –Fred Foo Aug 7 '13 at 14:20 I'm sorry, but how to define? –user2660959 Aug 7 '13 at 14:42 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote You need to define enum ion_permission_type before declaring permission_type enum ion_permission_type { /* Enumeration values here */ }; share|improve this answer answered Aug 7 '13 at 14:45 DrYap 3,99211845 add a comment| up vote 0 down vote It isn't able to find the definition of type enum ion_permission_type, so define it like below. enum ion_permission_type { /*define your named integer constants here...*/ }; share|improve this answer edited Aug 7 '13 at 14:56 DrYap 3,99211845 answered Aug 7 '13 at 14:52 Mahesh 692316 like: enum ion_permission_type /*permission for ion heap*/ ?? –user2660959 Aug 7 '13 at 15:45 Try this tutorial on enums –DrYap Aug 8 '13 at 15:56 Yes, If you are not sure how to define them, please go through the below link for basics of enum [link]yolinux.com/TUTORIALS/C++Enum.html –Mahesh Aug 9 '13 at 4:46 add a comment| up vote 0 down vote It should be defined in kernel/arch/arm/mach-msm/include/mach/ion.h with value enum ion_permission_type { IPT_T
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss field has incomplete type class the workings and policies of this site About Us Learn more field has incomplete type template about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack field has incomplete type 'char ' Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping http://stackoverflow.com/questions/18105185/field-permission-type-has-incomplete-type each other. Join them; it only takes a minute: Sign up C Typedef - Incomplete Type up vote 3 down vote favorite 1 So, out of the blue, the compiler decides to spit this in face: "field customer has incomplete type". Here's the relevant snippets of code: customer.c #include
question and get tips & solutions from a community of 418,511 https://bytes.com/topic/c/answers/864338-error-field-has-incomplete-type IT Pros & Developers. It's quick & easy. error: field has incomplete type P: 8 nina01 Hi everybody!! I'm actually trying to construct a compiler with http://forum.arduino.cc/index.php?topic=58840.0 flex and bison. But when I try to compile the"lex.yy.c" file on cygwin I keep having this error: Expand|Select|Wrap|Line Numbers $gcc-clex.yy.c InfileincludedfromSimple.l:4 Simple.y:60:error:field'typeval'hasincompletetype In fact, typeval's has incomplete type is an enum 'type' that I've defined in 'ST.h': Expand|Select|Wrap|Line Numbers typedefenumtypetype; enumtype{Int,Bool}; and tht I'v included in 'Simple.y': Expand|Select|Wrap|Line Numbers #ifndefST_H #defineST_H #include"ST.h" #endif ...... %unionsemrec{intintval; char*id; enumtypetypeval;//line:60 structlbs*lbls;} I really don't know what to do in order to fix this error :-( Help pleeease! It's urgent... Feb 21 '09 #1 has incomplete type Post Reply Share this Question 6 Replies 100+ P: 687 newb16 This compiles on my mingw (gcc3.4.5 ) \MinGW\bin\gcc.exe b.c Expand|Select|Wrap|Line Numbers typedefenumtypetype; enumtype{Int,Bool}; unionsemrec{intintval; enumtypetypeval;//line:60 }; Feb 21 '09 #2 reply P: 8 nina01 First of all, thanks for your reply... I don't think this is due to cygwin because the program compiled without any problem before I added that enum. :-( Feb 21 '09 #3 reply Expert 100+ P: 2,295 donbock @nina01 1. In the typedef you ask the compiler to consider typedef name 'type' to mean the same as 'enum type'. At this point you haven't told the compiler what 'enum type' is. Although I think this kind of forward reference is legitimate, it might be stressing your compiler. I suggest moving the typedef after the enum. By the way, you could combine these two statements: Expand|Select|Wrap|Line Numbers typedefenumtype{Int,Bool}type; 2. You are using the same name for the enum and the typedef.
> Programming Questions > enumeration Print Go Down Pages: [1] Topic: enumeration(Read 789 times) previous topic - next topic largos Newbie Posts: 24 Karma: 0[add] enumeration Apr 18, 2011, 04:40 pm struct Timer {enum TIMERSTATE eEtat ;unsigned long ulValue ;unsigned long ulTempo ;} ;why i'd got an error that say : error: field 'eEtat' has incomplete type robtillaart Global Moderator Brattain Member Posts: 18,138 Karma: 1002[add] In theory there is no difference between theory and practice, however in practice there are many... Re: enumeration #1 Apr 18, 2011, 04:43 pm you must define the enum outside/before the struct like belowCode: [Select]
enum TIMERSTATE {A, B };
struct Timer {
TIMERSTATE eEtat ;
unsigned long ulValue ;
unsigned long ulTempo ;
} ;
void setup(){}
void loop(){}
Rob TillaartNederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -(Please do not PM for private consultancy) Print Go Up Pages: [1] This link has expired. Please re-subscribe to our Newsletters. Subscribe to our Newsletters Email Please enter a valid email to subscribe Arduino Newsletter Arduino Store Newsletter Newsletter Italiana Cancel Next Confirm your email address We need to confirm your email address. To complete the subscription, please click the link in the email we just sent you. Thank you for subscribing! Arduino via Egeo 16 Torino, 10131 Italy Ok Newsletter ©2016 Arduino Copyright Notice Contact us Loading...