您的位置:首页 > 运维架构

解决unable to find string literal operator 'operator""fmt' with 'const char [15]', 编译问题

2017-03-16 14:59 1891 查看
#define show_log(tag, fmt, arg...)   printf("[%s][%s:%d]: "fmt"\n", tag, __func__, __LINE__, ##arg)

C可以编译通过,而C++编译出标题错误。

说是C++11要求,当字符串跟变量连接的时候,必须fmt前后增加一个空格才行。

#define show_log(tag, fmt, arg...)   printf("[%s][%s:%d]: "  fmt  "\n", tag, __func__, __LINE__, ##arg)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  printf C++ 编译
相关文章推荐