关于C99中的新特性:指定初始化 Designated initializers
2015-02-15 16:43
141 查看
在MSDN上找到个帖子:
SYNTAX ERROR : ( FFMPEG SOURCE CODE RUNNING ON VS2012)
在VS2012上编译ffmpeg遇到错误:AVInputFormat ff_yop_demuxer = {
.name = "yop", // error on dot operater
.long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP"),
.priv_data_size = sizeof(YopDecContext),
.read_probe = yop_probe,
.read_header = yop_read_header,
.read_packet = yop_read_packet,
.read_close = yop_read_close,
.read_seek = yop_read_seek,
.extensions = "yop",
.flags = AVFMT_GENERIC_INDEX,
};
对结构体中的成员 进行指定初始化,例如: .name = "yop", 在VS2010 、VS2012 上不支持,VS2013才支持
编译时报错,就是下图中 红色的地方
https://social.msdn.microsoft.com/Forums/vstudio/en-US/66a83f44-11d7-4630-9c52-b47db0fe9f66/syntax-error-ffmpeg-source-code-running-on-vs2012?forum=vcgeneral http://www.drdobbs.com/the-new-c-declarations-initializations/184401377 http://www.cnblogs.com/shadow21/p/4076986.html http://stackoverflow.com/questions/23986521/c2059-in-vs2012-how-to-initialize-struct-instance http://blog.csdn.net/adaptiver/article/details/7494081 http://blog.csdn.net/chgaowei/article/details/8629819
相关文章推荐
- 【数组】C99的新特性:指定初始化项目
- C99 Designated initializers(结构体指定初始化)
- 指定初始化项目(C99)
- C99 结构体指定初始化
- 关于ligerUi的ligertree的初始化默认选中指定项目的方法
- C99标准支持结构体按成员名称进行指定初始化。
- C99 结构体指定初始化
- C99 指定初始化
- C99的指定初始化转化为C89?用(a|e)?bnf实现吧,写个玩玩
- c99 指定初始化项目
- 关于linux中内核编程中结构体的赋值操作(结构体指定初始化)
- 关于linux中内核编程中结构体的赋值操作 (结构体指定初始化)
- C99 Designated initializers(结构体指定初始化)
- 二维数组,二维vector的声明初始化,&传递(iter,模板,C99特性),iterator遍历
- 关于Web2.0特性的一点感受(部分摘取他人的文章)
- 关于C++类成员的初始化
- 关于foxmail的研究2----找到帐户邮件箱的指定路径篇
- 关于初始化
- 关于C++类成员的初始化
- 关于C99 more