LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Included Linux headers - functions not recognised by compiler (https://www.linuxquestions.org/questions/linux-newbie-8/included-linux-headers-functions-not-recognised-by-compiler-4175424999/)

gudrun 08-31-2012 11:45 AM

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

bigrigdriver 09-01-2012 06:11 AM

I suspect the function declaration is missing.

gudrun 09-02-2012 06:14 AM

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?

pixellany 09-02-2012 08:32 AM

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?

gudrun 09-02-2012 01:43 PM

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.....

gudrun 09-03-2012 02:24 AM

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.


All times are GMT -5. The time now is 03:40 AM.