错误提示:连接 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就可以。


  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值