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

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

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

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

    [LV.1]初来乍到

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

    EDA365欢迎您登录!

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

    x

    ; \4 Q  A9 {( S* H[root@qljt globalmem]# make -C /linux_kernel/linux-2.6.30/ M=/linux_drivers/06/globalmem/ modules0 [  o  O# D# n2 u6 U( B
    0 r" W& M. a( X  ~/ H4 m, H* m8 f
    make: Entering directory `/linux_kernel/linux-2.6.30'
    # U" y/ E3 L* W7 Y% u- {9 D2 d& J2 V- d
    CC [M] /linux_drivers/06/globalmem/globalmem.o' c! O; Y; k3 Q
      C& ]6 O+ u- M% @
    In file included from include/linux/gfp.h:4,
    ) i" q8 v' v& l8 {7 U3 l7 X5 Q# f4 c0 y) |$ U8 F
    from include/linux/kmod.h:22,  w5 w- J; c3 t& \, J+ F7 f% U
    & q" e; Q4 W% j# X0 _
    from include/linux/module.h:13,
    + ?: T  n% ?: Z# y/ K7 B. W" I7 K  c: A. @, W: T+ ^
    from /linux_drivers/06/globalmem/globalmem.c:7:6 [+ \1 i" E/ |& c2 \

    ( R7 W7 a& S8 y* _# f. Winclude/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory. F4 ~6 y' M6 n

    ' f, y- ?. \; D* u% G3 oinclude/linux/mmzone.h:256:5: warning: "MAX_NR_ZONES" is not defined) ^% n1 W' g& H: r! Y
    & I$ M9 x+ J* O. H* m9 j
    In file included from include/linux/gfp.h:4,
    * j+ D, a! Q1 {
    9 S; F6 u) |6 D2 ^" C5 ufrom include/linux/kmod.h:22,
    / U& Q+ O& B) P. y% g: C# v+ ?! E) k: c0 L$ W
    from include/linux/module.h:13,
    7 z! o% n8 n! d* s" `1 |+ X8 J2 p( k0 ]3 b' e; ]5 D& ~( [& _: H
    from /linux_drivers/06/globalmem/globalmem.c:7:% o; V& @4 q7 R; Y3 f
    2 e& x% ?$ T* u+ N( G, l
    include/linux/mmzone.h:290: error: 'MAX_NR_ZONES' undeclared here (not in a function)
    ( r$ Z6 T  c1 |3 ^9 d/ x7 b7 W
    , r" S! {6 F1 |8 W( L- p. sIn file included from /linux_drivers/06/globalmem/globalmem.c:11:' F. r# Z- Z) X' a! _5 ]

    " ?# C5 a4 G. ?include/linux/mm.h:446:63: warning: "NR_PAGEFLAGS" is not defined8 a7 j# e7 S- f- }% {+ }: h! w
      m4 |% m' [7 [  S2 s1 A9 V
    include/linux/mm.h:494:62: warning: "NR_PAGEFLAGS" is not defined. W* i- m" c; c9 S8 x
    : K- d5 u# K, i
    /linux_drivers/06/globalmem/globalmem.c: In function 'globalmem_read':
    0 y4 k# ?' l3 E  N0 x& G! {* W- E! h2 B: n8 X: E
    /linux_drivers/06/globalmem/globalmem.c:89: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
    ; O4 O2 U9 v/ j" w3 k1 T/ v  @- @3 e
    /linux_drivers/06/globalmem/globalmem.c: In function 'globalmem_write':
    2 k% k: Q1 @; r$ f0 G2 K8 d
    # `3 Y8 b' n/ N6 @% d/linux_drivers/06/globalmem/globalmem.c:118: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
    0 [+ ]6 y: [& E1 ^* U& E1 J4 c* e* v7 w; N0 t
    make[1]: *** [/linux_drivers/06/globalmem/globalmem.o] Error 1$ j$ K# E" f5 E6 S0 r
    - ~  s+ W* J2 l& R  s
    make: *** [_module_/linux_drivers/06/globalmem] Error 21 @3 R# A0 P! }6 x  e  p$ }4 P
    ' e: ]2 J* p6 A/ W& Q
    make: Leaving directory `/linux_kernel/linux-2.6.30
      V% {: q  F- N! J! i& E% A$ U4 Z5 H
    解决的办法:+ e& x0 `4 T1 a/ U% b5 V

    7 w4 i5 q: g9 ^! _到你内核的根目录下执行1 l; W' V( D% f. \
    5 \! V) K  ~& p1 s9 `! F2 o) B8 w
    #make zImage 或
    , R/ [  U8 w! Y0 G" e' N* E, S7 g
    #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-10-25 13:50 , Processed in 0.125000 second(s), 24 queries , Gzip On.

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

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

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