LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 04-07-2006, 06:25 PM   #1
mprabu20
LQ Newbie
 
Registered: Dec 2005
Posts: 1

Rep: Reputation: 0
Cool while compiling c programme it's showing errors in header files


hi all
I am new to linux , I have just written a c programme to get pid of a current process. in that i have included the header file <linux/sched.h>


But while compiling in red hat linux 9.0 (2.40.8 ) i have got errors in the code of header files.

the errors were as follows


can any one help me in this regard.
error messages
**************************************

[root@localhost mcc]# cc t1.c
In file included from /usr/include/linux/sched.h:13,
from t1.c:3:
/usr/include/linux/times.h:5: parse error before "clock_t"
/usr/include/linux/times.h:7: parse error before "tms_cutime"
/usr/include/linux/times.h:8: parse error before "tms_cstime"
In file included from /usr/include/linux/sched.h:14,
from t1.c:3:
/usr/include/linux/timex.h:173: field `time' has incomplete type
In file included from /usr/include/linux/bitops.h:69,
from /usr/include/asm/system.h:7,
from /usr/include/linux/sched.h:16,
from t1.c:3:
/usr/include/asm/bitops.h:327:2: warning: #warning This includefile is not available on all architectures.
/usr/include/asm/bitops.h:328:2: warning: #warning Using kernel headers in userspace: atomicity not guaranteed
In file included from /usr/include/linux/signal.h:4,
from /usr/include/linux/sched.h:25,
from t1.c:3:
/usr/include/asm/signal.h:107: parse error before "sigset_t"
/usr/include/asm/signal.h:110: parse error before '}' token
In file included from /usr/include/linux/signal.h:5,
from /usr/include/linux/sched.h:25,
from t1.c:3:
/usr/include/asm/siginfo.h:26: parse error before "pid_t"
/usr/include/asm/siginfo.h:38: parse error before "pid_t"
/usr/include/asm/siginfo.h:41: parse error before '}' token
/usr/include/asm/siginfo.h:45: parse error before "pid_t"
/usr/include/asm/siginfo.h:48: parse error before "_utime"
/usr/include/asm/siginfo.h:49: parse error before "_stime"
/usr/include/asm/siginfo.h:62: parse error before '}' token
/usr/include/asm/siginfo.h:63: parse error before '}' token
In file included from /usr/include/linux/sched.h:78,
from t1.c:3:
/usr/include/linux/time.h:10: parse error before "time_t"
/usr/include/linux/time.h:12: parse error before '}' token
/usr/include/linux/time.h:18: parse error before "time_t"
/usr/include/linux/time.h:44: field `it_interval' has incomplete type
/usr/include/linux/time.h:45: field `it_value' has incomplete type
/usr/include/linux/time.h:49: field `it_interval' has incomplete type
/usr/include/linux/time.h:50: field `it_value' has incomplete type
In file included from /usr/include/linux/sched.h:80,
from t1.c:3:
/usr/include/linux/resource.h:22: field `ru_utime' has incomplete type
/usr/include/linux/resource.h:23: field `ru_stime' has incomplete type
In file included from /usr/include/linux/sched.h:81,
from t1.c:3:
/usr/include/linux/timer.h:32: field `vec' has incomplete type
/usr/include/linux/timer.h:37: field `vec' has incomplete type
/usr/include/linux/timer.h:45: parse error before "spinlock_t"
/usr/include/linux/timer.h:53: parse error before '}' token
/usr/include/linux/timer.h:63: field `list' has incomplete type
/usr/include/linux/timer.h:67: parse error before "tvec_base_t"
/usr/include/linux/timer.h:101: parse error before "tvec_bases"
/usr/include/linux/timer.h: In function `init_timer':
/usr/include/linux/timer.h:105: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:105: dereferencing pointer to incomplete type
/usr/include/linux/timer.h:106: dereferencing pointer to incomplete type
/usr/include/linux/timer.h: In function `timer_pending':
/usr/include/linux/timer.h:121: dereferencing pointer to incomplete type

Last edited by mprabu20; 04-07-2006 at 06:28 PM.
 
Old 04-08-2006, 02:07 AM   #2
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Can you tell me why you use root for compiling?! It's like you want bad things to happen
Never use the name of root in vain!

Please post the contents of t1.c .
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem compiling c++ header in slack 10.1 tommyj27 Slackware 2 10-28-2005 05:10 PM
Including header files and source files for classes Feenix Programming 8 09-28-2005 10:53 AM
Compiling C++ Header Files ?? JinBaba Programming 3 07-20-2005 03:23 AM
c header files in linux in place of header files in windows? harun_acs Programming 1 03-17-2004 02:24 AM
compiling header files with anjuta santiagom5 Linux - Software 7 01-30-2004 12:59 AM


All times are GMT -5. The time now is 06:45 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration