From: Sean Neakums <sneakums@zork.net>
To: Marcus Alanen <marcus@infa.abo.fi>
Cc: ramands@indiatimes.com, <linux-kernel@vger.kernel.org>
Subject: Re: Compilation Error: variable has intializer but incomplete type
Date: Tue, 01 Apr 2003 10:24:53 +0100 [thread overview]
Message-ID: <6u65pyd0yi.fsf@zork.zork.net> (raw)
In-Reply-To: <200304010907.h3197Mi20706@infa.abo.fi> (Marcus Alanen's message of "Tue, 1 Apr 2003 12:07:22 +0300")
commence Marcus Alanen quotation:
>>i am trying to learn and write device driver on linux kernel 2.4 redhat
>> distribution
>>
>>iam getting compilation errors for driver code.
>>struct file_operations my_ops ={NULL,my_read,my_write,NULL,NULL,NULL
>>NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
>>NULL };
>>
>>ERROR -> my_ops has intializer but incomplete type
>
> This is not a good way to do it. See e.g. fs/pipe.c#read_fifo_fops
> for an easier approach:
>
> struct file_operations read_fifo_fops = {
> llseek: no_llseek,
> read: pipe_read,
> write: bad_pipe_w,
> poll: fifo_poll,
> ioctl: pipe_ioctl,
> open: pipe_read_open,
> release: pipe_read_release,
> };
Aside from this, the main issue is the "has intializer but incomplete
type" error, which indicates that the definition of struct
file_operations has not been seen by the compiler. This seems to be
defined (in 2.4.20, at least) by include/linux/fs.h, so Raman will
need to #include that file for the initialization to work.
--
Sean Neakums - <sneakums@zork.net>
next prev parent reply other threads:[~2003-04-01 9:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-01 4:34 ramands
2003-04-01 9:07 ` Marcus Alanen
2003-04-01 9:24 ` Sean Neakums [this message]
2003-04-01 10:21 ` Jörn Engel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6u65pyd0yi.fsf@zork.zork.net \
--to=sneakums@zork.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marcus@infa.abo.fi \
--cc=ramands@indiatimes.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®