找回密码
 注册
关于网站域名变更的通知
查看: 289|回复: 2
打印 上一主题 下一主题

如果在编译模块的时候,出现下面这个莫名奇怪的错误,你是怎样解决的?

[复制链接]
  • TA的每日心情

    2019-11-20 15:22
  • 签到天数: 2 天

    [LV.1]初来乍到

    跳转到指定楼层
    1#
    发表于 2020-3-25 09:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

    EDA365欢迎您登录!

    您需要 登录 才可以下载或查看,没有帐号?注册

    x
    , o  x3 w7 S4 T
    [root@qljt globalmem]# make -C /linux_kernel/linux-2.6.30/ M=/linux_drivers/06/globalmem/ modules* V3 v% v) S  D
    # }% E9 _& b, d
    make: Entering directory `/linux_kernel/linux-2.6.30'& C) {4 x" c, Z- P

    : X: \1 |4 I5 a* I8 N( iCC [M] /linux_drivers/06/globalmem/globalmem.o$ ~# Z5 v7 M  q* j: o
    ) c' L0 ^/ h3 `8 R. f5 _
    In file included from include/linux/gfp.h:4,
    " p, L& A8 K% L0 i3 @) }' n
    3 f% g) X4 w: L- P! |from include/linux/kmod.h:22,
    7 X& H! g6 _; a% ^' n1 v: H/ M- V7 [
    from include/linux/module.h:13,! U' g0 O# ^* p+ ?7 r' C/ T

    7 E5 N0 _5 ^% y9 r4 v  E# Vfrom /linux_drivers/06/globalmem/globalmem.c:7:
    6 S' f4 {. A  U' _% ~) ]1 z! [1 c7 @- ^
    include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory% t# D! d2 T- t

    $ U, Y; I2 i3 Y: n3 `0 j! Binclude/linux/mmzone.h:256:5: warning: "MAX_NR_ZONES" is not defined! |# s) H4 w" j9 k8 y8 `0 T9 }
    ! n# c. j0 u6 H8 `4 M9 O/ K# f& s
    In file included from include/linux/gfp.h:4,
    . N( x8 c9 g2 B# Q! k/ t, d: w# n1 q# ^' e
    from include/linux/kmod.h:22,  E0 B7 p7 M* u( O% c1 w

    8 P: Q) e5 l( S: W' S4 q( ]% `" s" dfrom include/linux/module.h:13,! V/ Y" S! A0 |4 K3 Y
    % J6 @, G1 J" U2 c
    from /linux_drivers/06/globalmem/globalmem.c:7:, i6 N3 F4 W1 o2 F2 h1 }

    + L( y$ U  E4 D/ c& V4 Iinclude/linux/mmzone.h:290: error: 'MAX_NR_ZONES' undeclared here (not in a function)
    , D, r4 v; Y6 }; {2 @# o! T5 Z
    5 u+ M1 [& G+ \# D# p5 s8 }In file included from /linux_drivers/06/globalmem/globalmem.c:11:
    3 ?0 I3 Q6 c2 L: H  n
    1 R: B5 K* n% e# H6 Cinclude/linux/mm.h:446:63: warning: "NR_PAGEFLAGS" is not defined
    4 n: ?; w* Z) f" ^: n$ d; e: j& w( D" M
    include/linux/mm.h:494:62: warning: "NR_PAGEFLAGS" is not defined
    ' l/ C( r3 Y2 q' z9 n3 h$ Q' ^) i: H  y/ t% L2 X9 x
    /linux_drivers/06/globalmem/globalmem.c: In function 'globalmem_read':
    * e' k# D9 L/ m4 A( {( t0 }% n- u, w. Y3 B
    /linux_drivers/06/globalmem/globalmem.c:89: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'9 b; E+ o* o4 {/ Y9 X1 a
    & n2 B" g5 Z# w$ Z0 q. V. X. y
    /linux_drivers/06/globalmem/globalmem.c: In function 'globalmem_write':; t3 j0 Q  q, p

    - B* R7 y% B. s% c2 U( H/linux_drivers/06/globalmem/globalmem.c:118: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int', r$ }3 G7 o# E1 Q; V. R
    $ `# L, N7 F* c
    make[1]: *** [/linux_drivers/06/globalmem/globalmem.o] Error 1. j& b# j; Q% |3 _' c2 I6 ~( ^
    ; q) C7 X2 O% ]; T% V
    make: *** [_module_/linux_drivers/06/globalmem] Error 2% X' z3 w' q" G& B" W+ O

    " O- P- K' w- i, v& ^/ N) wmake: Leaving directory `/linux_kernel/linux-2.6.30
    7 N; D, i2 Q$ Y* z- ?4 c* ^& e& g) q4 ]: r' U2 |
    解决的办法:0 M# f! M0 C4 `0 F- U
    4 [8 T0 l- I! g  a  ^1 c
    到你内核的根目录下执行0 Q, [. C4 c2 F* K7 U
    2 t; ~+ }# @/ p: }7 K2 {
    #make zImage 或6 Y& N! n; d" t/ d6 t; O
    3 P, s( L: A' ], i" E! R2 t# B6 ]
    #make prepare

    该用户从未签到

    2#
    发表于 2020-3-25 17:50 | 只看该作者
    答案这么简单啊
  • TA的每日心情
    开心
    2023-5-29 15:28
  • 签到天数: 230 天

    [LV.7]常住居民III

    3#
    发表于 2020-3-26 08:50 | 只看该作者
    linux编译还没有搞过,粗略一看一头雾水,看来要加大学习力度了。
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

    推荐内容上一条 /1 下一条

    EDA365公众号

    关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

    GMT+8, 2025-11-25 23:05 , Processed in 0.171875 second(s), 24 queries , Gzip On.

    深圳市墨知创新科技有限公司

    地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

    快速回复 返回顶部 返回列表