Compiling dependent module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I have a situation where, I have one parent module in ../hello/
directory which exports one symbol (g_my_export). I have a dependent
module in ../hello1/ directory. Both have it's own makefiles.
Compiling of parent module (hello.ko) is fine, but during compilation
of dependent module (hello1.ko) I see a warning that g_my_export is
undefined.

On the other hand when I do depmod -a and modprobe, dependent module
inserts successfully in kernel.

I want to remove compile time warning. What should I do?

The source and makefile of both parent and dependent module is
attached with this mail.

Thanks
Devesh.
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");

int g_my_export = 0xA ;

static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}

EXPORT_SYMBOL(g_my_export) ;

module_init(hello_init);
module_exit(hello_exit);

Attachment: Makefile
Description: Binary data

#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");

extern int g_my_export ;

static int hello_init(void)
{
    printk(KERN_ALERT "Hello, world1\n");
    
    printk("Value in g_my_export=%d\n",g_my_export) ;
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world1\n");
}

module_init(hello_init);
module_exit(hello_exit);

Attachment: Makefile
Description: Binary data


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux