gpt4 book ai didi

c++ - 语法错误 : missing '{ ' before '.'

转载 作者:行者123 更新时间:2023-12-04 23:35:29 24 4
gpt4 key购买 nike

我有一个 AVOption结构体:

static const AVOption options[] = {  
COMMON_OPTIONS // error here
{ NULL }
};

COMMON_OPTIONS定义为:
#define COMMON_OPTIONS \
{ "interp", "select interpolation mode", OFFSET(interpolation), AV_OPT_TYPE_INT, {.i64=INTERPOLATE_TETRAHEDRAL}, 0, NB_INTERP_MODE-1, FLAGS, "interp_mode" }, \
{NULL}

我收到一个错误:
2>c:\users\awki6\desktop\ffmpeg\libavfilter\vsrc_testsrc.cpp(98): error C2143: syntax error : missing '}' before '.'

最佳答案

您的 COMMON_OPTIONS宏已经有了{ NULL }并且不以 , 结尾, 所以:

static const AVOption options[] = {  
COMMON_OPTIONS
};

将解决您的问题。

编辑前的过去答案:
即使我们不知道 COMMON_OPTIONS 是什么意思展开到,我猜你只是想念它后面的逗号:
static const AVOption options[] = {  
COMMON_OPTIONS,
// ^
{ NULL }
};

关于c++ - 语法错误 : missing '{ ' before '.' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19562805/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com