LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-31-2012, 11:45 AM   #1
gudrun
LQ Newbie
 
Registered: Nov 2011
Posts: 6

Rep: Reputation: Disabled
Post Included Linux headers - functions not recognised by compiler


Hi!

In one file I have following Linux headers included:
#include <linux/jiffies.h>
#include <linux/time.h>
#include <linux/trace_clock.h>

However, compiler gives me error only for functions from linux/trace_clock.h:
WARNING: "trace_clock" [/work/xxxxxxxxx_my_work_directory_xxxxx] undefined!

Any thoughts?
thx
 
Old 09-01-2012, 06:11 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
I suspect the function declaration is missing.
 
Old 09-02-2012, 06:14 AM   #3
gudrun
LQ Newbie
 
Registered: Nov 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
But function declaration is in linux/trace_clock.h i.e. the header included. Does it have to do something with the fact that it is a Linux function? Has it been exported for use by other modules? Do I have to do it? And how?
 
Old 09-02-2012, 08:32 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I think you'll need to figure out exactly where the compiler is creating this error message. Also, how do we interpret the message? The way I read it, it says:
Quote:
In the file "trace_clock", the term "/work/xxxxxxxxx_my_work_directory_xxxxx" is not defined
Indepentent of this question, can you search all the relevant files and find that string?

Finally, are you using a standard set of kernel headers---or has something been customized?
 
Old 09-02-2012, 01:43 PM   #5
gudrun
LQ Newbie
 
Registered: Nov 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you, pixellany!
The term "/work/xxxxxxxxx_my_work_directory_xxxxx" refers to the location and name of the file in which the headers named above (#include <linux/trace_clock.h> as well) are included. It seems that although the prototype of this function (trace_clock) is in this header, the compiler does not see it for some reason.....
 
Old 09-03-2012, 02:24 AM   #6
gudrun
LQ Newbie
 
Registered: Nov 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Found it. trace_clock.h does not declare trace_clock_counter() function which was added, apparently, at the later point in time than my header file comes from.

Thanks you for your time.
 
  


Reply



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
How headers are included though the path is not showing the header folder mnowhere Linux - Newbie 10 08-07-2012 02:34 AM
Command to list headers included in a .ko files theoutkast Programming 6 07-11-2011 10:12 AM
[SOLVED] Underscores in standard functions, an example section from cat.c is included. pr_deltoid Programming 1 09-04-2010 10:49 PM
Functions #included don't want to behave MattFunke Programming 4 11-12-2007 09:14 AM
gcc compiler error / linux headers install help SciYro Linux - Software 2 12-07-2003 01:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:43 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