LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-13-2006, 04:20 PM   #1
imsandy_007
LQ Newbie
 
Registered: Nov 2006
Distribution: SuSe 10.1 , Knoppix
Posts: 15

Rep: Reputation: 0
Error in including sched.h


i am writing a simple code, but getting too much errors.
the code follows: test.c

#include<linux/sched.h>

int main()
{
return 1;
}

i am compiling as: gcc test.c
please suggest me how to include the file
 
Old 11-13-2006, 04:40 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Where is the file located?

Using
#include <some path to file>
tells the compiler to look in standard system include locations (such as /usr/include, /usr/local/include).

Using
#include "somepath to file"
tells the compiler to look in a location relative to the current directory being compiled in (such as /home/use/src/project/include).

You can use commandline options to your gcc command to add other directories to the search path (with the -I option). Read the gcc man page regarding that option to find out details of how the -I option affects the search order for include files.
 
Old 11-17-2006, 11:26 AM   #3
imsandy_007
LQ Newbie
 
Registered: Nov 2006
Distribution: SuSe 10.1 , Knoppix
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Dark_Helmet
Where is the file located?

Using
#include <some path to file>
tells the compiler to look in standard system include locations (such as /usr/include, /usr/local/include).

Using
#include "somepath to file"
tells the compiler to look in a location relative to the current directory being compiled in (such as /home/use/src/project/include).

You can use commandline options to your gcc command to add other directories to the search path (with the -I option). Read the gcc man page regarding that option to find out details of how the -I option affects the search order for include files.

I have done what you told me do?
still it is giving a lot of errors...
Actually the default path where the header files are placed is generally /usr/include, and "sched.h" is in /usr/include/linux so the path given by me right...

i tried compiling by giving the options:
gcc test.c -I /usr/include/
and even with
gcc test.c -I /usr/include/linux

both are still generating errors
 
Old 11-20-2006, 02:44 AM   #4
pradeepgopireddy
LQ Newbie
 
Registered: Nov 2006
Posts: 2

Rep: Reputation: 0
try with

#include<sched.h>

int main()
{
return 1;
}
 
Old 11-20-2006, 02:50 AM   #5
pradeepgopireddy
LQ Newbie
 
Registered: Nov 2006
Posts: 2

Rep: Reputation: 0
#include<sched.h>

int main()
{
return 1;
}
 
Old 11-20-2006, 04:10 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Maybe you should post the error message. And you're missing a space as far as I can see (but that might be a typo here on the forum).
Code:
#include<linux/sched.h>
#include <linux/sched.h>
        ^
        ^

Last edited by Wim Sturkenboom; 11-20-2006 at 04:12 AM.
 
Old 11-20-2006, 11:54 PM   #7
k1ll3r_x
Member
 
Registered: Sep 2004
Location: Laredo, TX
Distribution: Debian 11
Posts: 164

Rep: Reputation: 30
try putting sched.h in the same folder as the cpp file, if not the original a copy, that way you dont have to do the pathfile
 
Old 11-21-2006, 12:35 PM   #8
imsandy_007
LQ Newbie
 
Registered: Nov 2006
Distribution: SuSe 10.1 , Knoppix
Posts: 15

Original Poster
Rep: Reputation: 0
list of errors

this is the list of errors that have resulted from compiling the code:

#include<linux/sched.h>

int main()
{
return 0;
}




In file included from /usr/include/linux/timex.h:61,
from /usr/include/linux/sched.h:11,
from test.c:1:
/usr/include/asm/timex.h: In function 'get_cycles':
/usr/include/asm/timex.h:40: error: 'cpu_has_tsc' undeclared (first use in this
function)
/usr/include/asm/timex.h:40: error: (Each undeclared identifier is reported only
once
/usr/include/asm/timex.h:40: error: for each function it appears in.)
In file included from /usr/include/linux/sched.h:12,
from test.c:1:
/usr/include/linux/jiffies.h: At top level:
/usr/include/linux/jiffies.h:75: error: expected ',' or ';' before 'jiffies_64'
/usr/include/linux/jiffies.h:79: error: expected '=', ',', ';', 'asm' or '__attr
ibute__' before 'get_jiffies_64'
In file included from /usr/include/linux/sched.h:12,
from test.c:1:
/usr/include/linux/jiffies.h:250:47: error: division by zero in #if
/usr/include/linux/jiffies.h: In function 'jiffies_to_msecs':
/usr/include/linux/jiffies.h:253: error: 'MSEC_PER_SEC' undeclared (first use in
this function)
/usr/include/linux/jiffies.h:261:47: error: division by zero in #if
/usr/include/linux/jiffies.h: In function 'jiffies_to_usecs':
/usr/include/linux/jiffies.h:264: error: 'USEC_PER_SEC' undeclared (first use in
this function)
/usr/include/linux/jiffies.h:274:47: error: division by zero in #if
/usr/include/linux/jiffies.h: In function 'msecs_to_jiffies':
/usr/include/linux/jiffies.h:277: error: 'MSEC_PER_SEC' undeclared (first use in
this function)
/usr/include/linux/jiffies.h:287:47: error: division by zero in #if
/usr/include/linux/jiffies.h: In function 'usecs_to_jiffies':
/usr/include/linux/jiffies.h:290: error: 'USEC_PER_SEC' undeclared (first use in
this function)
/usr/include/linux/jiffies.h: In function 'timespec_to_jiffies':
/usr/include/linux/jiffies.h:311: error: called object 'u64' is not a function
/usr/include/linux/jiffies.h:311: error: called object 'u64' is not a function
/usr/include/linux/jiffies.h:311: error: 'NSEC_PER_SEC' undeclared (first use in
this function)
/usr/include/linux/jiffies.h:312: error: called object 'u64' is not a function
/usr/include/linux/jiffies.h:312: error: called object 'u64' is not a function
/usr/include/linux/jiffies.h:315: error: expected ')' before 'sec'
/usr/include/linux/jiffies.h:316: error: expected ')' before 'nsec'
/usr/include/linux/jiffies.h: In function 'jiffies_to_timespec':
/usr/include/linux/jiffies.h:328: error: expected ';' before 'nsec'
/usr/include/linux/jiffies.h:329: error: 'nsec' undeclared (first use in this fu
nction)
/usr/include/linux/jiffies.h:329: error: 'NSEC_PER_SEC' undeclared (first use in
this function)
/usr/include/linux/jiffies.h: In function 'timeval_to_jiffies':
/usr/include/linux/jiffies.h:350: error: called object 'u64' is not a function
/usr/include/linux/jiffies.h:350: error: called object 'u64' is not a function
/usr/include/linux/jiffies.h:350: error: 'NSEC_PER_SEC' undeclared (first use in
this function)
/usr/include/linux/jiffies.h:351: error: called object 'u64' is not a function
/usr/include/linux/jiffies.h:351: error: called object 'u64' is not a function
/usr/include/linux/jiffies.h:354: error: expected ')' before 'sec'
/usr/include/linux/jiffies.h:355: error: expected ')' before 'usec'
/usr/include/linux/jiffies.h: In function 'jiffies_to_timeval':
/usr/include/linux/jiffies.h:366: error: expected ';' before 'nsec'
/usr/include/linux/jiffies.h:369: error: 'nsec' undeclared (first use in this fu
nction)
/usr/include/linux/jiffies.h:369: error: 'NSEC_PER_SEC' undeclared (first use in
this function)
/usr/include/linux/jiffies.h:370: error: 'NSEC_PER_USEC' undeclared (first use i
n this function)
/usr/include/linux/jiffies.h:379:41: error: division by zero in #if
/usr/include/linux/jiffies.h:379:42: error: division by zero in #if
/usr/include/linux/jiffies.h: In function 'jiffies_to_clock_t':
/usr/include/linux/jiffies.h:382: error: expected ';' before 'tmp'
/usr/include/linux/jiffies.h:383: error: 'NSEC_PER_SEC' undeclared (first use in
this function)
/usr/include/linux/jiffies.h:383: error: 'USER_HZ' undeclared (first use in this
function)
/usr/include/linux/jiffies.h:383: error: 'tmp' undeclared (first use in this fun
ction)
/usr/include/linux/jiffies.h:383: error: invalid lvalue in asm output 0
/usr/include/linux/jiffies.h:390:18: error: division by zero in #if
/usr/include/linux/jiffies.h: In function 'clock_t_to_jiffies':
/usr/include/linux/jiffies.h:395: error: expected ';' before 'jif'
/usr/include/linux/jiffies.h:398: error: 'USER_HZ' undeclared (first use in this
function)
/usr/include/linux/jiffies.h:402: error: 'jif' undeclared (first use in this fun
ction)
/usr/include/linux/jiffies.h:402: error: expected ';' before numeric constant
/usr/include/linux/jiffies.h:403: error: invalid lvalue in asm output 0
/usr/include/linux/jiffies.h: At top level:
/usr/include/linux/jiffies.h:408: error: expected '=', ',', ';', 'asm' or '__att
ribute__' before 'jiffies_64_to_clock_t'
/usr/include/linux/jiffies.h:410:41: error: division by zero in #if
/usr/include/linux/jiffies.h:410:42: error: division by zero in #if
/usr/include/linux/jiffies.h:424: error: expected '=', ',', ';', 'asm' or '__att
ribute__' before 'nsec_to_clock_t'
/usr/include/linux/jiffies.h:426:28: error: division by zero in #if
In file included from /usr/include/linux/cpumask.h:86,
from /usr/include/linux/sched.h:15,
from test.c:1:
/usr/include/linux/bitmap.h: In function 'bitmap_zero':
/usr/include/linux/bitmap.h:125: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_fill':
/usr/include/linux/bitmap.h:140: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_copy':
/usr/include/linux/bitmap.h:146: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_and':
/usr/include/linux/bitmap.h:157: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_or':
/usr/include/linux/bitmap.h:166: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_xor':
/usr/include/linux/bitmap.h:175: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_andnot':
/usr/include/linux/bitmap.h:184: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_complement':
/usr/include/linux/bitmap.h:193: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_equal':
/usr/include/linux/bitmap.h:202: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_intersects':
/usr/include/linux/bitmap.h:211: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_subset':
/usr/include/linux/bitmap.h:220: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_empty':
/usr/include/linux/bitmap.h:228: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_full':
/usr/include/linux/bitmap.h:236: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_shift_right':
/usr/include/linux/bitmap.h:250: error: 'BITS_PER_LONG' undeclared (first use in
this function)
/usr/include/linux/bitmap.h: In function 'bitmap_shift_left':
/usr/include/linux/bitmap.h:259: error: 'BITS_PER_LONG' undeclared (first use in
this function)
In file included from /usr/include/linux/sched.h:15,
from test.c:1:
/usr/include/linux/cpumask.h: At top level:
/usr/include/linux/cpumask.h:88: error: expected specifier-qualifier-list before
'DECLARE_BITMAP'
/usr/include/linux/cpumask.h: In function '__cpu_set':
/usr/include/linux/cpumask.h:94: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpu_clear':
/usr/include/linux/cpumask.h:100: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_setall':
/usr/include/linux/cpumask.h:106: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_clear':
/usr/include/linux/cpumask.h:112: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpu_test_and_set':
/usr/include/linux/cpumask.h:121: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_and':
/usr/include/linux/cpumask.h:128: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:128: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:128: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_or':
/usr/include/linux/cpumask.h:135: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:135: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:135: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_xor':
/usr/include/linux/cpumask.h:142: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:142: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:142: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_andnot':
/usr/include/linux/cpumask.h:150: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:150: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:150: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_complement':
/usr/include/linux/cpumask.h:157: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:157: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_equal':
/usr/include/linux/cpumask.h:164: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:164: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_intersects':
/usr/include/linux/cpumask.h:171: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:171: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_subset':
/usr/include/linux/cpumask.h:178: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:178: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_empty':
/usr/include/linux/cpumask.h:184: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_full':
/usr/include/linux/cpumask.h:190: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_weight':
/usr/include/linux/cpumask.h:196: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_shift_right':
/usr/include/linux/cpumask.h:204: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:204: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_shift_left':
/usr/include/linux/cpumask.h:212: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:212: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__first_cpu':
/usr/include/linux/cpumask.h:218: error: expected expression before 'int'
/usr/include/linux/cpumask.h: In function '__next_cpu':
/usr/include/linux/cpumask.h:224: error: expected expression before 'int'
/usr/include/linux/cpumask.h: In function '__cpumask_scnprintf':
/usr/include/linux/cpumask.h:275: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpumask_parse':
/usr/include/linux/cpumask.h:283: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpulist_scnprintf':
/usr/include/linux/cpumask.h:291: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpulist_parse':
/usr/include/linux/cpumask.h:297: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpu_remap':
/usr/include/linux/cpumask.h:305: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:305: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function '__cpus_remap':
/usr/include/linux/cpumask.h:313: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:313: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:313: error: 'cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:313: error: 'cpumask_t' has no member named 'bits'
In file included from /usr/include/linux/sched.h:17,
from test.c:1:
/usr/include/linux/nodemask.h: At top level:
/usr/include/linux/nodemask.h:88: error: expected specifier-qualifier-list befor
e 'DECLARE_BITMAP'
/usr/include/linux/nodemask.h: In function '__node_set':
/usr/include/linux/nodemask.h:94: error: 'nodemask_t' has no member named 'bits'
/usr/include/linux/nodemask.h: In function '__node_clear':
/usr/include/linux/nodemask.h:100: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_setall':
/usr/include/linux/nodemask.h:106: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_clear':
/usr/include/linux/nodemask.h:112: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__node_test_and_set':
/usr/include/linux/nodemask.h:122: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_and':
/usr/include/linux/nodemask.h:130: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:130: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:130: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_or':
/usr/include/linux/nodemask.h:138: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:138: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:138: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_xor':
/usr/include/linux/nodemask.h:146: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:146: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:146: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_andnot':
/usr/include/linux/nodemask.h:154: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:154: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:154: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_complement':
/usr/include/linux/nodemask.h:162: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:162: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_equal':
/usr/include/linux/nodemask.h:170: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:170: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_intersects':
/usr/include/linux/nodemask.h:178: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:178: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_subset':
/usr/include/linux/nodemask.h:186: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:186: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_empty':
/usr/include/linux/nodemask.h:192: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_full':
/usr/include/linux/nodemask.h:198: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_weight':
/usr/include/linux/nodemask.h:204: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_shift_right':
/usr/include/linux/nodemask.h:212: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:212: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_shift_left':
/usr/include/linux/nodemask.h:220: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:220: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__first_node':
/usr/include/linux/nodemask.h:229: error: expected expression before 'int'
/usr/include/linux/nodemask.h: In function '__next_node':
/usr/include/linux/nodemask.h:235: error: expected expression before 'int'
/usr/include/linux/nodemask.h: In function '__first_unset_node':
/usr/include/linux/nodemask.h:253: error: expected expression before 'int'
/usr/include/linux/nodemask.h: In function '__nodemask_scnprintf':
/usr/include/linux/nodemask.h:288: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodemask_parse':
/usr/include/linux/nodemask.h:296: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodelist_scnprintf':
/usr/include/linux/nodemask.h:304: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodelist_parse':
/usr/include/linux/nodemask.h:310: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__node_remap':
/usr/include/linux/nodemask.h:318: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:318: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h: In function '__nodes_remap':
/usr/include/linux/nodemask.h:326: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:326: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:326: error: 'nodemask_t' has no member named 'bits
'
/usr/include/linux/nodemask.h:326: error: 'nodemask_t' has no member named 'bits
'
In file included from /usr/include/linux/sched.h:19,
from test.c:1:
/usr/include/asm/system.h: At top level:
/usr/include/asm/system.h:302: error: expected declaration specifiers or '...' b
efore 'u8'
/usr/include/asm/system.h:302: error: expected declaration specifiers or '...' b
efore 'u8'
/usr/include/asm/system.h:303: error: expected declaration specifiers or '...' b
efore 'u16'
/usr/include/asm/system.h:303: error: expected declaration specifiers or '...' b
efore 'u16'
/usr/include/asm/system.h:304: error: expected declaration specifiers or '...' b
efore 'u32'
/usr/include/asm/system.h:304: error: expected declaration specifiers or '...' b
efore 'u32'
/usr/include/asm/system.h: In function 'cmpxchg_386':
/usr/include/asm/system.h:311: error: too many arguments to function 'cmpxchg_38
6_u8'
/usr/include/asm/system.h:313: error: too many arguments to function 'cmpxchg_38
6_u16'
/usr/include/asm/system.h:315: error: too many arguments to function 'cmpxchg_38
6_u32'
In file included from /usr/include/linux/sched.h:23,
from test.c:1:
/usr/include/asm/mmu.h: At top level:
/usr/include/asm/mmu.h:13: error: field 'sem' has incomplete type
In file included from /usr/include/asm/cputime.h:4,
from /usr/include/linux/sched.h:24,
from test.c:1:
/usr/include/asm-generic/cputime.h:23: error: expected '=', ',', ';', 'asm' or '
__attribute__' before 'cputime64_t'
In file included from /usr/include/linux/smp.h:19,
from /usr/include/linux/sched.h:26,
from test.c:1:
/usr/include/asm/smp.h:46: error: expected '=', ',', ';', 'asm' or '__attribute_
_' before 'x86_cpu_to_apicid'
/usr/include/asm/smp.h: In function 'num_booting_cpus':
/usr/include/asm/smp.h:69: error: 'CONFIG_NR_CPUS' undeclared (first use in this function)
In file included from /usr/include/linux/signal.h:4,
from /usr/include/linux/sched.h:28,
from test.c:1:
/usr/include/linux/list.h:814:2: warning: #warning "don't include kernel headers
in userspace"
In file included from /usr/include/asm/siginfo.h:4,
from /usr/include/linux/signal.h:7,
from /usr/include/linux/sched.h:28,
from test.c:1:
/usr/include/asm-generic/siginfo.h: At top level:
/usr/include/asm-generic/siginfo.h:58: error: size of array '_pad' is too large
In file included from /usr/include/linux/sched.h:30,
from test.c:1:
/usr/include/linux/fs_struct.h:9: error: expected specifier-qualifier-list before 'rwlock_t'
In file included from /usr/include/linux/sched.h:32,
from test.c:1:
/usr/include/linux/completion.h:15: error: expected specifier-qualifier-list bef
ore 'wait_queue_head_t'
/usr/include/linux/completion.h: In function 'init_completion':
/usr/include/linux/completion.h:27: error: 'struct completion' has no member nam
ed 'wait'
In file included from /usr/include/linux/sched.h:33,
from test.c:1:
/usr/include/linux/pid.h: At top level:
/usr/include/linux/pid.h:17: error: field 'pid_chain' has incomplete type
/usr/include/linux/pid.h:19: error: field 'pid_list' has incomplete type
In file included from test.c:1:
/usr/include/linux/sched.h:98: error: expected declaration specifiers or '...' b
efore 'process_counts'
In file included from /usr/include/linux/sched.h:107,
from test.c:1:
/usr/include/linux/timer.h:12: error: field 'entry' has incomplete type
In file included from /usr/include/linux/hrtimer.h:19,
from /usr/include/linux/sched.h:108,
from test.c:1:
/usr/include/linux/ktime.h:47: error: expected specifier-qualifier-list before '
s64'
/usr/include/linux/ktime.h: In function 'ktime_set':
/usr/include/linux/ktime.h:145: error: unknown field 'tv' specified in initializ
er
/usr/include/linux/ktime.h:145: error: extra brace group at end of initializer
/usr/include/linux/ktime.h:145: error: (near initialization for '(anonymous)')
/usr/include/linux/ktime.h: In function 'ktime_sub':
/usr/include/linux/ktime.h:160: error: 'ktime_t' has no member named 'tv64'
/usr/include/linux/ktime.h:160: error: 'ktime_t' has no member named 'tv64'
/usr/include/linux/ktime.h:160: error: 'ktime_t' has no member named 'tv64'
/usr/include/linux/ktime.h:161: error: 'ktime_t' has no member named 'tv'
/usr/include/linux/ktime.h:162: error: 'ktime_t' has no member named 'tv'
/usr/include/linux/ktime.h:162: error: 'NSEC_PER_SEC' undeclared (first use in t
his function)
/usr/include/linux/ktime.h: In function 'ktime_add':
/usr/include/linux/ktime.h:179: error: 'ktime_t' has no member named 'tv64'
/usr/include/linux/ktime.h:179: error: 'ktime_t' has no member named 'tv64'
/usr/include/linux/ktime.h:179: error: 'ktime_t' has no member named 'tv64'
/usr/include/linux/ktime.h:188: error: 'ktime_t' has no member named 'tv'
/usr/include/linux/ktime.h:188: error: 'NSEC_PER_SEC' undeclared (first use in t his function)
/usr/include/linux/ktime.h:189: error: 'ktime_t' has no member named 'tv64'
/usr/include/linux/ktime.h:189: error: 'u32' undeclared (first use in this function)
 
Old 11-21-2006, 12:45 PM   #9
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Quote:
Originally Posted by Wim Sturkenboom
Maybe you should post the error message. And you're missing a space as far as I can see (but that might be a typo here on the forum).
Code:
#include<linux/sched.h>
#include <linux/sched.h>
        ^
        ^
Acutally it doesent matter cause C ignores whitespace.



As far as the OP issue I would say your not includeing the library in the compile command. findout what library it is and include it.
 
Old 11-21-2006, 01:15 PM   #10
imsandy_007
LQ Newbie
 
Registered: Nov 2006
Distribution: SuSe 10.1 , Knoppix
Posts: 15

Original Poster
Rep: Reputation: 0
actually i want u all to see the first few lines of the error...

it gives a lot of help, but i am still unable to understand how a header file contains errors because it is given by the suse gcc library and all of them must be checked of errors
 
Old 11-21-2006, 11:12 PM   #11
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Quote:
Originally Posted by imsandy_007
Code:
In file included from /usr/include/linux/timex.h:61,
from /usr/include/linux/sched.h:11,
from test.c:1:
/usr/include/asm/timex.h: In function 'get_cycles':
/usr/include/asm/timex.h:40: error: 'cpu_has_tsc' undeclared (first use in this
function)
/usr/include/asm/timex.h:40: error: (Each undeclared identifier is reported only
once
/usr/include/asm/timex.h:40: error: for each function it appears in.)
The problem is not with including sched.h. The problem lies within a file that sched.h includes: timex.h

My guess is there are some define variables you need to specify on the command line. For example, the man pages for some functions require the compilation command to include "-DGNU_SOURCE" or some such option.

You will have to double-check documentation for whatever you're trying to accomplish, or manually inspect the header files to determine what is going wrong and why. Given that this header file is in the "asm" directory, my guess is you need to supply a processor-architecture option on the command line. The fact that other header files croak for (what appear to be potentially) architecture-related issues suggests there is something fundamentally wrong/missing.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in including linux/sched.h sudeepghiya Linux - General 1 11-02-2006 10:35 AM
Architecture dependency of switch_to in /kernel/sched.c skie_knite007 Programming 0 02-19-2006 08:40 AM
staircase vs O(1) (CPU sched) SciYro Linux - General 4 04-06-2005 03:07 PM
Compilation error when including <linux/ext3_fs.h> in SuSE Linux 9.0 (i586) seshasai Linux - Distributions 0 06-01-2004 03:22 AM
urgent:compiling problem sched.o error vsu Linux - General 1 12-01-2003 09:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration