错误提示:连接 built-in.o 提示 undefined reference to

今天编译内核的时候,由于我是按照别人的内核修改做的内核,内核版本号不一致所以编译出现了如下的错误:


arch/arm/mach-omap2/built-in.o: In function `map_xbar_event_to_channel':

/home/hello/work/kernel/am335x/linux-3.2.21/arch/arm/mach-omap2/devices.c:1058: undefined reference to `edma_cc'
/home/hello/work/kernel/am335x/linux-3.2.21/arch/arm/mach-omap2/devices.c:1066: undefined reference to `edma_cc'
arch/arm/mach-omap2/built-in.o: In function `omap_push_sram_idle':
/home/hello/work/kernel/am335x/linux-3.2.21/arch/arm/mach-omap2/pm34xx.c:771: undefined reference to `omap_gen_pool'
/home/hello/work/kernel/am335x/linux-3.2.21/arch/arm/mach-omap2/pm34xx.c:771: undefined reference to `omap_gen_pool'
/home/hello/work/kernel/am335x/linux-3.2.21/arch/arm/mach-omap2/pm34xx.c:771: undefined reference to `gen_pool_alloc'
/home/hello/work/kernel/am335x/linux-3.2.21/arch/arm/mach-omap2/pm34xx.c:774: undefined reference to `gen_pool_alloc'


后来发现,提示的这些文件函数都有声明头文件也有包括。

于是参考别人的博客:http://blog.chinaunix.net/uid-8391208-id-1739710.html 

上面的博客没有给出具体的路径方法。

下面给出具体路径方法:

以这个为例:

/home/hello/work/kernel/am335x/linux-3.2.21/arch/arm/mach-omap2/devices.c:1058: undefined reference to `edma_cc'

用source insight打开。找到edma_cc'定义所在的c文件。

比如我的edma_cc定义在了Edma.c (arch\arm\common)中

于是我修改arch\arm\common目录下的Makefile 指定obj-y      += edma.o就可以。


你可能感兴趣的:(linux)