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
- Follow-Ups:
- Re: Compiling dependent module
- From: Sam Ravnborg <sam@ravnborg.org>
- Re: Compiling dependent module
- Prev by Date: Re: [Alsa-user] Pb with simultaneous SATA and ALSA I/O
- Next by Date: [PATCH] [RESEND] Remove logic error in /Documentation/devices.txt
- Previous by thread: Problems with 2.6.18 and SATA DVD-RW Toshiba SH-W163A
- Next by thread: Re: Compiling dependent module
- Index(es):
![]() |