【发布时间】:2013-06-12 08:31:08
【问题描述】:
我正在使用 xcode 中的这个 utils.c 文件,它具有以下内容:
#if FF_API_AVCODEC_OPEN
int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
{
return avcodec_open2(avctx, codec, NULL);
}
这导致 xcode 在此行出现Expected ; after top level declarator, 错误(在构建期间):int attribute_align_arg avcodec_open(....
为什么?以及我应该怎么做才能解决这个问题。
谢谢。
【问题讨论】:
-
看起来
attribute_align_arg尚未定义。您需要包含适当的头文件,根据谷歌是libavutil/internal.h -
如果不是@CaptainObvlious 的解决方案,您提供的代码上面的行是什么?
-
@Captain Obvlious,
libavutil/internal.h包含在 xcodes 标头路径中。该错误与对象的定义无关,也与未找到的.h文件有关。这是关于(我认为)xcode 在上面声明中的int attribute_align_arg之后期待一个;。 -
@cube 这意味着要么未定义,要么扩展为有效的标识符名称。无论问题是什么,它都被解释为变量声明。