Sponsored Content
Top Forums Programming error: field has incomplete type Post 302131096 by boyanov on Thursday 9th of August 2007 07:20:21 AM
Old 08-09-2007
Yes, I include <linux/cdev.h> and <asm/semaphore.h> both in the test program and in my header file.
I found this in the above mentioned headers:
Code:
 #ifndef _LINUX_CDEV_H
 #define _LINUX_CDEV_H
 #ifdef __KERNEL__
 
 struct cdev {
         struct kobject kobj;
         struct module *owner;
         struct file_operations *ops;
         struct list_head list;
         dev_t dev;
         unsigned int count;
 };
...
#endif
#endif

Code:
 #ifdef __KERNEL__
 ...
 #include <asm/atomic.h>
 #include <asm/system.h>
 #include <linux/wait.h>
 #include <linux/rwsem.h>
 
 struct semaphore {
         atomic_t count;
         wait_queue_head_t wait;
 };
...
#endif

Does this mean that I have to wrap my struct definition with the __KERNEL__ define directive? I though it is included by defaul when compiling modules (or maybe it's not for user space apps?).
 

9 More Discussions You Might Find Interesting

1. Programming

Accesing structure member:Error:dereferencing pointer to incomplete type

$ gcc -Wall -Werror struct.c struct.c: In function `main': struct.c:18: error: dereferencing pointer to incomplete type $ cat struct.c #include <stdio.h> #include <stdlib.h> #include <string.h> /*Declaration of structure*/ struct human { char *first; char gender; int age; } man,... (3 Replies)
Discussion started by: amit4g
3 Replies

2. Programming

array type has incomplete element type

Dear colleagues, One of my friend have a problem with c code. While compiling a c program it displays a message like "array type has incomplete element type". Any body can provide a solution for it. Jaganadh.G (1 Reply)
Discussion started by: jaganadh
1 Replies

3. Programming

error: field `fatx_i' has incomplete type

I'm trying to compile a 2.4.26 kernel but I have to apply two patches to it. The patches are: linux-2.4.26-xbox.patch openMosix-2.4.26-1 This is the reason that it doesn't compile. There is only one error but I'm not familiar with C or C++(Unfortunately only Java and some lower-level... (2 Replies)
Discussion started by: lateralus01
2 Replies

4. UNIX for Dummies Questions & Answers

Build Error: error: dereferencing pointer to incomplete type

I'm getting the following Error: prepare_pcap.c: In function `prepare_pkts': prepare_pcap.c:127: error: dereferencing pointer to incomplete type prepare_pcap.c:138: error: dereferencing pointer to incomplete type ==================================== This is the part of the relevant... (8 Replies)
Discussion started by: katwala
8 Replies

5. Programming

Dereferencing pointer to incomplete type

// Hello all, I am having this error "Dereferencing pointer to incomplete type " on these 2 lines: xpoint = my_point->x; ypoint = my_point->y; I am having no clue y this is happening. Any help would be greately appreciated!!!! #include<stdio.h> #include<string.h>... (2 Replies)
Discussion started by: mind@work
2 Replies

6. Red Hat

What type of error is this?

:rolleyes::rolleyes::rolleyes: Jul 18 19:31:31 plbp1s sendmail: STARTTLS: read error=syscall error (-1), errno=104, get_error=error:00000000:lib(0):func(0):reason(0) ---------- Post updated at 03:08 AM ---------- Previous update was at 03:07 AM ---------- # cat /var/log/maillog|egrep -i... (2 Replies)
Discussion started by: manalisharmabe
2 Replies

7. UNIX for Advanced & Expert Users

find -exec with 2 commands doesn't work (error incomplete staement)

Hi Gurues, I need to modify an existing script that uses find to search a folder, and then move its contents to a folder. What I need to do is run gzip on each file after it's moved. So, I ran this little test: Put a ls.tar file on my $HOME, mkdir tmp, and then: virtuo@tnpmprd01: find .... (3 Replies)
Discussion started by: llagos
3 Replies

8. Programming

Compilation Error: dereferencing pointer to incomplete type

I am getting a dereferencing pointer to incomplete type error when i compile the following code on lines highlighted in red. Can anyone help me in identifying what is wrong in the code? #include<stdio.h> #include<stdlib.h> typedef struct{ int info; struct node* link ; } node; void... (3 Replies)
Discussion started by: sreeharshasn
3 Replies

9. Shell Programming and Scripting

Error type order

Hi all, Sample data file... 9f680197||y|a|6 9f6801||6 9f68017|20120511|y|6 9f68017|y|1 9f68017|6 9f68017|20120511|N|2 9f68017|MD|212343907|20120511|N|2 9f68017212343907|20120511|N|2 9f68017N|3 9f68017|20120511|y|3 9f68017|MD|212343907|20120511|N|3 9f68017|MD|212343907|20120511|y|3... (3 Replies)
Discussion started by: bmk
3 Replies
STRUCT 
USB_DEVICE(9) Host-Side Data Types and Macro STRUCT USB_DEVICE(9) NAME
struct_usb_device - kernel's representation of a USB device SYNOPSIS
struct usb_device { int devnum; char devpath[16]; u32 route; enum usb_device_state state; enum usb_device_speed speed; struct usb_tt * tt; int ttport; unsigned int toggle[2]; struct usb_device * parent; struct usb_bus * bus; struct usb_host_endpoint ep0; struct device dev; struct usb_device_descriptor descriptor; struct usb_host_config * config; struct usb_host_config * actconfig; struct usb_host_endpoint * ep_in[16]; struct usb_host_endpoint * ep_out[16]; char ** rawdescriptors; unsigned short bus_mA; u8 portnum; u8 level; unsigned can_submit:1; unsigned persist_enabled:1; unsigned have_langid:1; unsigned authorized:1; unsigned authenticated:1; unsigned wusb:1; int string_langid; char * product; char * manufacturer; char * serial; struct list_head filelist; #ifdef CONFIG_USB_DEVICE_CLASS struct device * usb_classdev; #endif #ifdef CONFIG_USB_DEVICEFS struct dentry * usbfs_dentry; #endif int maxchild; struct usb_device * children[USB_MAXCHILDREN]; u32 quirks; atomic_t urbnum; unsigned long active_duration; #ifdef CONFIG_PM unsigned long last_busy; int autosuspend_delay; unsigned long connect_time; unsigned do_remote_wakeup:1; unsigned reset_resume:1; unsigned autosuspend_disabled:1; #endif struct wusb_dev * wusb_dev; int slot_id; }; MEMBERS
devnum device number; address on a USB bus devpath[16] device ID string for use in messages (e.g., /port/...) route tree topology hex string for use with xHCI state device state: configured, not attached, etc. speed device speed: high/full/low (or error) tt Transaction Translator info; used with low/full speed dev, highspeed hub ttport device port on that tt hub toggle[2] one bit for each endpoint, with ([0] = IN, [1] = OUT) endpoints parent our hub, unless we're the root bus bus we're part of ep0 endpoint 0 data (default control pipe) dev generic device interface descriptor USB device descriptor config all of the device's configs actconfig the active configuration ep_in[16] array of IN endpoints ep_out[16] array of OUT endpoints rawdescriptors raw descriptors for each config bus_mA Current available from the bus portnum parent port number (origin 1) level number of USB hub ancestors can_submit URBs may be submitted persist_enabled USB_PERSIST enabled for this device have_langid whether string_langid is valid authorized policy has said we can use it; (user space) policy determines if we authorize this device to be used or not. By default, wired USB devices are authorized. WUSB devices are not, until we authorize them from user space. FIXME -- complete doc authenticated Crypto authentication passed wusb device is Wireless USB string_langid language ID for strings product iProduct string, if present (static) manufacturer iManufacturer string, if present (static) serial iSerialNumber string, if present (static) filelist usbfs files that are open to this device usb_classdev USB class device that was created for usbfs device access from userspace usbfs_dentry usbfs dentry entry for the device maxchild number of ports if hub children[USB_MAXCHILDREN] child devices - USB devices that are attached to this hub quirks quirks of the whole device urbnum number of URBs submitted for the whole device active_duration total time device is not suspended last_busy time of last use autosuspend_delay in jiffies connect_time time device was first connected do_remote_wakeup remote wakeup should be enabled reset_resume needs reset instead of resume autosuspend_disabled autosuspend disabled by the user wusb_dev if this is a Wireless USB device, link to the WUSB specific data for the device. slot_id Slot ID assigned by xHCI NOTES
Usbcore drivers should not set usbdev->state directly. Instead use usb_set_device_state. COPYRIGHT
Kernel Hackers Manual 2.6. July 2010 STRUCT USB_DEVICE(9)
All times are GMT -4. The time now is 04:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy