预期的 ;在顶级声明符之后,xcode 中出现错误 [英] Expected ; after top level declarator, error in xcode
问题描述
我正在 xcode 中使用这个 utils.c 文件,它具有以下内容:
I am working with this utils.c file in xcode, which has the following:
#if FF_API_AVCODEC_OPEN
int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
{
return avcodec_open2(avctx, codec, NULL);
}
它导致了 Expected ;在顶级声明符
之后,xcode 在这一行出现错误(在构建期间):int attribute_align_arg avcodec_open(....
It's causing an Expected ; after top level declarator
, error (during build) in xcode at this line: int attribute_align_arg avcodec_open(....
为什么?我该怎么做才能解决这个问题.
Why? and what should I do to resolve this.
谢谢.
推荐答案
我在使用自动完成时遇到了这个错误.
I ran into this error when using the auto completion.
在插入函数参数时,XCode 将插入需要编辑但在 GUI 中显示为完全有效的 C++ 的占位符.
When inserting the parameter of a function, XCode will insert placeholders that need to be edited but show as completely valid C++ in the GUI.
我花了几个小时,直到我在另一个编辑器中检查了我的文件,发现不是预期的:
It took me some hours until I checked my file in another editor, revealing that instead of the expected:
void func(int a)
void func(int a)
XCode 实际插入了
XCode had actually inserted
void func(<#int a#>)
void func(<#int a#>)
在 XCode 编辑器中,参数显示为带有浅蓝色背景的 int a
,因此不容易发现编译器错误的来源.
In the XCode editor the parameter shows as int a
with a light blue background, so it isn't easy to spot as the source of the compiler error.
这篇关于预期的 ;在顶级声明符之后,xcode 中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!