I am writing a kernel module that is comprised of several source files, One of these source files has a function that needs to be used by the other objects in the same module.
It is defined in my file named ModemAPI.c
static void LogMessage ( char *format, ...)
This c file should be (together with other files) compiled into one kernel module, its makefile looks like this:
obj-m += ModemAPI.o
ModemAPI-objs := ../Common/StateMachine.o ../Common/ElementsPool.o
When I compile this kernel module, I get a warning during linking that the above function "LogMessage" is undefined and when I try to load the module I get an error saying it has an unknown symbol in it (of course LogMessage).
EDIT: Just to make clear, the function "LogMessage" is declared and implemented in the file ModemAPI.c, moreover it is exported via EXPORT_SYMBOL
EXPORT_SYMBOL(LogMessage);
In the files that use the function (such as StateMachine.c), it is declared via extern
extern void LogMessage ( char *format, ...);
The module compiles, the problem is in the linking stage.
Does anyone have any idea what could be the problem with this?
Thanks, Roy.