ご存知の方がおられましたらよろしくお願いします。
>>---------- エラーの内容 ----------<<
variable 'hoge_hops' has initializer but incomplete type.
(エラーのラインは私のプログラムの"static struct file_operations hoge_fops="
の行で発生。)
>>---------- hs.hから抜粋 ----------<<
struct file_operations {
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*read) (struct file *, char *, size_t, loff_t *);
ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
int (*readdir) (struct file *, void *, filldir_t);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned
long);
int (*mmap) (struct file *, struct vm_area_struct *);
int (*open) (struct inode *, struct file *);
int (*flush) (struct file *);
int (*release) (struct inode *, struct file *);
int (*fsync) (struct file *, struct dentry *);
int (*fasync) (int, struct file *, int);
int (*lock) (struct file *, int, struct file_lock *);
};
>>---------- 私のプログラム ----------<<
static struct file_operations hoge_fops=
{
NULL, /* lseek */
hoge_read, /* read */
hoge_write, /* write */
NULL, /* readdir */
NULL, /* selcect */
NULL, /* ioctrl */
NULL, /* mmap */
hoge_open, /* open */
NULL, /* flush */
hoge_release, /* release */
NULL, /* fsync */
NULL, /* fasync */
NULL /* lock */
};
>LinuxのIncludeファイルのfs.hで定義されている構造体を使用しようとしているので
>すがコンパイルをかけると次のエラーが発生してコンパイルできません。
>”コンパイラのオプション設定の問題じゃない?”との情報をもらったので、コンパ
>イラのヘルプを見たのですが該当するような設定は見当たりませんでした。
>Turbo Linux上ででコンパイラはGCCを使用しています。
>
>ご存知の方がおられましたらよろしくお願いします。
>
>>>---------- エラーの内容 ----------<<
>variable 'hoge_hops' has initializer but incomplete type.
>(エラーのラインは私のプログラムの"static struct file_operations hoge_fops="
>の行で発生。)
良く分かんないですが、
% gcc -E ほげほげ.c | grep '^[ ]*$'
の結果に struct file_operations の定義はありますか?
__KERNEL__ を定義しないと宣言されないように見えますが、
それは丈夫ですか?
---------------------------------------------------------------------
tesi...@mtf.biglobe.ne.jp
> 良く分かんないですが、
>
> % gcc -E ほげほげ.c | grep '^[ ]*$'
すみません、
% gcc -E ほげほげ.c | grep -v '[ ]*$'
でした。
---------------------------------------------------------------------
tesi...@mtf.biglobe.ne.jp