+ -
当前位置:首页 → 问答吧 → 编译失败懂C言的来看看

编译失败懂C言的来看看

时间:2011-01-11

来源:互联网

编译失败这是返回的
MPG12PLAY -o vo_ivtv.o vo_ivtv.c
vo_ivtv.c: In function 'ivtv_reset':
vo_ivtv.c:79: error: storage size of 'sd' isn't known
vo_ivtv.c:80: error: storage size of 'sd1' isn't known
vo_ivtv.c:85: error: 'IVTV_IOC_STOP_DECODE' undeclared (first use in this function)
vo_ivtv.c:85: error: (Each undeclared identifier is reported only once
vo_ivtv.c:85: error: for each function it appears in.)
vo_ivtv.c:95: error: 'IVTV_IOC_START_DECODE' undeclared (first use in this function)
make[1]: *** [vo_ivtv.o] Error 1
这是原码
77        ivtv_reset (int blank_screen)
    78        {
    79          struct ivtv_cfg_stop_decode sd;
    80          struct ivtv_cfg_start_decode sd1;
    81       
    82          sd.hide_last = blank_screen;
    83          sd.pts_stop = 0;
    84         
    85          if (ioctl (ivtv_fd, IVTV_IOC_STOP_DECODE, &sd) < 0)
    86          {
    87            mp_msg (MSGT_VO, MSGL_ERR,
    88                    "IVTV_IOC_STOP_DECODE: %s\n", strerror (errno));
    89            return 1;
    90          }
    91          
    92          sd1.gop_offset = 0;
    93          sd1.muted_audio_frames = 0;
    94          
    95          if (ioctl (ivtv_fd, IVTV_IOC_START_DECODE, &sd1) < 0)
    96          {
    97            mp_msg (MSGT_VO, MSGL_ERR,
    98                    "IVTV_IOC_START_DECODE: %s\n", strerror (errno));
    99            return 1;
   100          }
   101       
   102          return 0;
   103        }
有没有懂看的来看看怎么错了

作者: wshong2005   发布时间: 2011-01-11

configure  的时候加上 --disable-ivtv

作者: deepwhite   发布时间: 2011-01-11

没有包含相应的头文件

作者: unicornsir   发布时间: 2011-01-12

首先提一下第85行和95行的,C语言是区分大小写的,所以,如果那个标识符想表示一个类型,那么需要变成小写。
然后是第79和80行的,提示的意思大约是编译器不知道要为两个变量分配多少空间。把包含相关的类型的定义的头文件放到文件的最前面,编译时可能还要链接相应的文件。

作者: pl_014   发布时间: 2011-01-13

热门下载

更多