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

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

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

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

    [LV.1]初来乍到

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

    EDA365欢迎您登录!

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

    x
    6 K$ N, W3 A# H* W7 e4 y& x
    [root@qljt globalmem]# make -C /linux_kernel/linux-2.6.30/ M=/linux_drivers/06/globalmem/ modules* F. C0 @, P2 t" d& }0 A+ y

    # H2 q: C* P( O: ]# wmake: Entering directory `/linux_kernel/linux-2.6.30'
    3 ]: }0 M& \  a; I
    1 F# f" t2 Q3 W. uCC [M] /linux_drivers/06/globalmem/globalmem.o
    $ G1 a$ F0 H. ]$ N$ k9 a0 ?/ [' @+ @! x1 Z: i8 a& G
    In file included from include/linux/gfp.h:4,
    / [0 C4 t) K& ?  _' U3 @+ U$ G8 U3 v* `
    / t6 y3 _: O4 a! P( Cfrom include/linux/kmod.h:22,
    ' ]( _3 T% e1 J" h9 I6 y0 X: M4 [- d2 p5 ]7 {$ o; A) `
    from include/linux/module.h:13,; l, u6 s* C' s' f& V6 Y
    $ ]4 C0 V: g% Q# I: A% {
    from /linux_drivers/06/globalmem/globalmem.c:7:
      n5 N7 a, S, y" A7 F1 a! V6 }/ o2 v$ I" f% J; k3 c. U4 [5 p
    include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory/ ~; A9 ~# T3 q; m* t: D

    7 V. w$ k% p* ]. vinclude/linux/mmzone.h:256:5: warning: "MAX_NR_ZONES" is not defined
    1 z8 R, M, [* L1 J/ H3 f3 C4 Q+ P( [( v% ~* |
    In file included from include/linux/gfp.h:4,
    1 {+ O% ~' O6 z3 A& s$ u
    ' a& K# k5 w8 Rfrom include/linux/kmod.h:22,
    ; M& X1 s: B5 P
    - z+ o/ J  W- D2 B4 `from include/linux/module.h:13,
    . X' {# \! q+ [  r
    - g2 M& [( S! _: ]8 R2 Ofrom /linux_drivers/06/globalmem/globalmem.c:7:! ^: a% b3 k5 C, ~

    ( W& l; _% b6 i( o" h" x9 X- X1 Zinclude/linux/mmzone.h:290: error: 'MAX_NR_ZONES' undeclared here (not in a function), U& J2 K/ r8 S/ X" i
    - g7 ^& h8 T2 ?# @0 ?3 `
    In file included from /linux_drivers/06/globalmem/globalmem.c:11:" |# f6 ^+ \3 P$ A: a6 _
    , ~+ B- R& U, f& q; O8 v; u5 x
    include/linux/mm.h:446:63: warning: "NR_PAGEFLAGS" is not defined
    3 I4 l: c2 c! ]& Z) R- b6 T$ Z9 z; J2 C# g
    include/linux/mm.h:494:62: warning: "NR_PAGEFLAGS" is not defined# Q+ [. k! R, ]/ }" \! _

    ( U7 o$ L6 d; _. c; q6 a: _' ]) Z0 w/linux_drivers/06/globalmem/globalmem.c: In function 'globalmem_read':& ~5 u2 G, a0 `. O; ^* t' i9 W
    # @. e# d; s$ p6 f
    /linux_drivers/06/globalmem/globalmem.c:89: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'# U. Z  T' ^; K( \3 [
    + |( r! b* O- N7 K7 u  ]
    /linux_drivers/06/globalmem/globalmem.c: In function 'globalmem_write':
    8 M' o% k, d! V$ f7 b" X* w3 L; Q
    4 ?) w  n% G  n. N6 D' a, [9 @& E: K/linux_drivers/06/globalmem/globalmem.c:118: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
    . [$ K2 J' x$ K) C" u
    7 o! {% u+ g" V( s' j5 }make[1]: *** [/linux_drivers/06/globalmem/globalmem.o] Error 1
    " l, z- ~; }. Z- i5 R+ T  w
    - S2 K0 s: l+ {. B# ]' H, ]# [! Mmake: *** [_module_/linux_drivers/06/globalmem] Error 2
    . X+ i  |7 v! I% ^5 d' W7 p8 f
    . f, m& |; J- rmake: Leaving directory `/linux_kernel/linux-2.6.30
    8 T7 t: n3 Z0 C8 }! [
    : c9 k9 S1 t& |# r# Z' G/ \解决的办法:
    2 z( s7 m& _" `5 z  B2 y  h& W8 h! H6 u/ E+ H' E( |& z, l
    到你内核的根目录下执行
    - T, o# n7 ?  {5 _: L
    3 i  }& R/ ]% y" y( l#make zImage 或# t- _( T1 y0 O  Y6 ~3 H

    * a' h0 Z( F& K$ g% a#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-26 01:30 , Processed in 0.156250 second(s), 23 queries , Gzip On.

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

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

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