Error Field Has Incomplete Type C
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions error field has incomplete type struct you might have Meta Discuss the workings and policies of this
Error Field St_atim Has Incomplete Type
site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers field has incomplete type array or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a field has incomplete type class community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up C: field has incomplete type up vote 3 down vote favorite I apologise if this has been previously asked. I am getting the following error while compiling through make: .../inc/intModIp.h:418: error: field 'cnc_id'
Field Has Incomplete Type Template
has incomplete type ../inc/intModIp.h:419: error: field 'cnc_key' has incomplete type ../inc/intModIp.h:421: error: field 'fin_id' has incomplete type ../inc/intModIp.h:422: error: field 'fin_key' has incomplete type ../inc/intModIp.h:424: error: field 'remote_id' has incomplete type ../inc/intModIp.h:426: error: field 'cnc_ipsec_peer' has incomplete type ../inc/intModIp.h:427: error: field 'fin_ipsec_peer' has incomplete type ../inc/intModIp.h:428: error: field 'remote_ipsec_peer' has incomplete type ../inc/intModIp.h:430: error: field 'cnc_link' has incomplete type ../inc/intModIp.h:431: error: field 'cnc_esp' has incomplete type ../inc/intModIp.h:433: error: field 'fin_link' has incomplete type ../inc/intModIp.h:434: error: field 'fin_esp' has incomplete type Respective code in the header file is as follows: #if 1 || defined(SYMB_IPSEC) struct ipsec_state { int enabled; int active; int timer; /* IPSEC_SOCKET_STATES */ struct ipsec_id cnc_id; struct ipsec_priv_key cnc_key; struct ipsec_id fin_id; struct ipsec_priv_key fin_key; struct ipsec_id remote_id; struct ipsec_peer cnc_ipsec_peer; struct ipsec_peer fin_ipsec_peer; struct ipsec_peer remote_ipsec_peer; struct ipsec_ike_link cnc_link; struct ipsec_esp_sa cnc_esp; struct ipsec_ike_link fin_link; struct ipsec_esp_sa fin_esp; } ipsec; #endif could someone please help me with this. Please let me know if any
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 field has incomplete type enum company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions field has incomplete type 'char ' Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million
Field Has Incomplete Type Struct Sockaddr
programmers, just like you, helping each other. Join them; it only takes a minute: Sign up error: field has incomplete type up vote 1 down vote favorite I am attempting to port a library to Mac OS http://stackoverflow.com/questions/17291268/c-field-has-incomplete-type X. The compiler is reporting an incomplete type error. Specifically: field has incomplete type 'header_t []. However, when I look at the source code, header_t is defined just before packet_state_t, where packet_state_t references header_t. Thus, there shouldn't be any forward reference error, since header_t is clearly defined at the point at which it is referenced inside packet_state_t. The line in which the error occurs is marked with ERROR below. How to resolve? typedef http://stackoverflow.com/questions/26880048/error-field-has-incomplete-type struct header_t { uint8_t hdr_id; // header ID uint8_t hdr_prefix; // length of the prefix (preamble) before the header uint8_t hdr_gap; // length of the gap between header and payload uint16_t hdr_flags; // flags for this header uint16_t hdr_postfix; // length of the postfix (trailer) after the payload uint32_t hdr_offset; // offset into the packet_t->data buffer uint32_t hdr_length; // length of the header in packet_t->data buffer uint32_t hdr_payload; // length of the payload uint8_t hdr_subcount; // number of sub-headers header_t *hdr_subheader; // Index of the first subheader in packet_t jobject hdr_analysis; // Java JAnalysis based object if not null } header_t; typedef struct packet_state_t { flow_key_t pkt_flow_key; // Flow key calculated for this packet, must be first uint8_t pkt_flags; // flags for this packet jobject pkt_analysis; // Java JAnalysis based object if not null uint64_t pkt_frame_num; // Packet's frame number assigned by scanner uint64_t pkt_header_map; // bit map of presence of headers uint32_t pkt_wirelen; // Original packet size uint32_t pkt_buflen; // Captured length int8_t pkt_header_count; // total number of main headers found header_t pkt_headers[]; // One per header + 1 more for payload ERROR HERE!!! int8_t pkt_subheader_count; // total number of sub headers found header_t pkt_subheaders[]; // One per header + 1 more for payload } packet_state_t; c struct share|improve this question edited Nov 12 '14 at 6:04
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User https://ubuntuforums.org/showthread.php?t=1673733 Documentation Social Media Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu http://www.cplusplus.com/forum/general/76794/ Specialised Support Development & Programming Programming Talk Field has incomplete type Having an Issue With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks has incomplete ! Results 1 to 2 of 2 Thread: Field has incomplete type Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode January 23rd, 2011 #1 cguy View Profile View Forum Posts Private Message Frothy Coffee! Join Date Jan 2009 Beans 237 DistroKubuntu 10.10 Maverick Meerkat Field has incomplete type This is the code: Code: struct directory; typedef struct directory directory_t; typedef has incomplete type struct file { char name[256]; unsigned long size; date_t created; date_t modified; directory_t parent; <---------- This line is troublesome }file_t; struct directory { char name; struct directory *parent; date_t created; date_t modified; }; and this is the compilation error: Code: error: field 'parent' has incomplete type But I declared the second structure's prototype and then declared a type definition. Why do I still get an error? Adv Reply January 23rd, 2011 #2 worksofcraft View Profile View Forum Posts Private Message Cake for coffee's sake Join Date Sep 2007 Location Christchurch, New Zealand Beans 1,328 DistroUbuntu Re: Field has incomplete type Originally Posted by cguy This is the code: Code: struct directory; typedef struct directory directory_t; typedef struct file { char name[256]; unsigned long size; date_t created; date_t modified; directory_t parent; <---------- This line is troublesome }file_t; struct directory { char name; struct directory *parent; date_t created; date_t modified; }; and this is the compilation error: Code: error: field 'parent' has incomplete type But I declared the second structure's prototype and then declared a type definition. Why do I still get an error? That is correct. The declaration of struct directory is AFTER the definition of "parent"... so when the compiler is trying to work out the size of your struct file... it d
password for it. I'm more or less of a newbie at coding in c++, so this is kind of a long shot and I doubt I'll be able to make this work, but hey, whateves. But the error I'm currently working with is this bit of code here. I have a class called Account and I'm trying to make an object for it, like so: Account AccountObj; But the error I get is like so: error: aggregate 'Account AccountObj' has incomplete type and cannot be defined What could possibly be happening? Aug 7, 2012 at 8:44pm UTC TwoOfDiamonds (58) Please post a the full Account header or whatever it is declared in :) Aug 7, 2012 at 8:45pm UTC vlad from moscow (6539) You have not shown your class definition so I can only guess that its definition has a member with incomplete type/ For example 1
2
3
4
5
6
struct A; struct B { A a; }; Here class B has member a with incomplete type because class A was not defined yet. Or another example 1
2
3
4
struct A { int arr[]; }; Here class A also has a member with incomplete type because the size of the arr is not specified. Aug 7, 2012 at 8:49pm UTC Bufflez (38) Oook, so chances are that its a problem with my account class? should I post my whole class or just this: #include "Account.h.h" I think I might have named my class 'Account.h' by complete accident, but whenever I make an object of the class like this: Account.h accountObj; It doesn't work. I'm so very confuzed. Please tell me if I should post my whole program. Aug 7, 2012 at 8:57pm UTC vlad from moscow (6539) Why do you use two extensions for the header file? You should show your class definition that is all its member declarations between open and closing braces. Last edited on Aug 7, 2012 at 9:07pm UTC Aug 7, 2012 at 9:00pm UTC Bufflez (38) Sorry, haha I might be a lot newer than you think. what are extensions for the head