开发者

What's wrong with linux/ext2_fs.h?

cat main.c

#include <stdio.h>
#include <stdlib.h>
#include <linux/ext2_fs.h>

int main(int argc, char** argv) {

    return (EXIT_SUCCESS);
}

Here is my output...

gcc main.c In file included from main.c:3:

/usr/include/linux/ext2_fs.h: In function ‘ext2_mask_flags’:

/usr/include/linux/ext2_fs.h:182: error: ‘FS_DIRSYNC_FL’ undeclared (first use in this function)

/usr/include/linux/ext2_fs.h:182: error: (Each undeclared identifier is reported only once

/usr/include/linux/ext2_fs.h:182: error: for each function it appears in.)

/usr/include/linux/ext2_fs.h:182: error: ‘FS_TOPDIR_FL’ undeclared (first use in this function)

/usr/include/linux/ext2_fs.h:184: error: ‘FS_NODUMP_FL’ un开发者_StackOverflowdeclared (first use in this function)

/usr/include/linux/ext2_fs.h:184: error: ‘FS_NOATIME_FL’ undeclared (first use in this function)

If I remove #include <linux/ext2_fs.h> the program compiles successfully...


You need to add #include <linux/fs.h>


You need to add #include <linux/fs.h> before including the #include <linux/ext2_fs.h>


I had no idea, so I put ext2_fs.h into Google and this was the 4th result.

The behaviour seems to be considered a bug.


I fixed it with:

#include <sys/stat.h>
#include <linux/fs.h>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜