You are not logged in.

#1 2010-01-07 12:43:16

pejotr
Member
Registered: 2009-11-07
Posts: 16

ext2_fs.h errors

Hi,

i'm trying to compile following code:

#include <linux/ext2_fs.h>

int main()
{
  return 0;
}

and i'm getting following errors:

In file included from test.cpp:1:
/usr/include/linux/ext2_fs.h: In function '__u32 ext2_mask_flags(umode_t, __u32)':
/usr/include/linux/ext2_fs.h:179: error: 'S_ISDIR' was not declared in this scope
/usr/include/linux/ext2_fs.h:181: error: 'S_ISREG' was not declared in this scope
/usr/include/linux/ext2_fs.h:182: error: 'FS_DIRSYNC_FL' was not declared in this scope
/usr/include/linux/ext2_fs.h:182: error: 'FS_TOPDIR_FL' was not declared in this scope
/usr/include/linux/ext2_fs.h:184: error: 'FS_NODUMP_FL' was not declared in this scope
/usr/include/linux/ext2_fs.h:184: error: 'FS_NOATIME_FL' was not declared in this scope

I tried compile it on Ubuntu and everything works fine.

Last edited by pejotr (2010-01-07 12:43:56)

Offline

#2 2010-01-07 13:59:48

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: ext2_fs.h errors

// test.c
// compile with gcc test.c
#include <linux/fs.h>
#include <linux/ext2_fs.h>

int main()
{
  return 0;
}

This compiles for me. You can normally fix those sort of errors by grepping around /usr/include for the missing include files. This doesn't work if you try to compile it as C++ though.

Offline

Board footer

Powered by FluxBB