Advertisement

编译问题的小集合

阅读量:

一 错误

1、 error: return type is an incomplete type

翻译过来的意思是:返回的类型属于未完整定义的类型。

此处出现该问题的原因在于,编写函数接口时,返回值为结构体指针,但在声明函数返回类型时,仅指定了对应的结构体名称。

存在错误的代码示例如下:

复制代码
 struct SwrContext swr_config(struct SwrContext *s, AVFormatContext *ic, S32 stream_index)

    
 {
    
     if(NULL == s)
    
     {
    
     s = swr_alloc();
    
     }
    
     s = swr_alloc_set_opts(s,          // we're allocating a new context
    
         AV_CH_LAYOUT_STEREO,  // out_ch_layout
    
         AV_SAMPLE_FMT_S32,      // out_sample_fmt
    
         SWR_SAMPLE_RATE,      // out_sample_rate

全部评论 (0)

还没有任何评论哟~