红联Linux门户
Linux帮助

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

发布时间:2016-11-13 09:39:33来源:linux网站作者:bigPillow
今天编译内核的时候,由于我是按照别人的内核修改做的内核,内核版本号不一致所以编译出现了如下的错误:
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'
 
后来发现,提示的这些文件函数都有声明头文件也有包括。
于是参考:
错误提示:连接built-in.o提示undefined reference to
上面也没有给出具体的路径方法。
 
下面给出具体路径方法:
以这个为例:
/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就可以。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/25962.html