海思编译报错 unable to find string literal operator 'operator""format' with 'const char [15]',

半城伤御伤魂 提交于 2019-12-11 06:57:19

#define PRINT_ERR(format,...)  printf( "Err [%s():%d] "format, __FUNCTION__, __LINE__, ##__VA_ARGS__)

该函数在arm-himix200-linux-g++ 报错

error: unable to find string literal operator 'operator""format' with 'const char [15]', 'unsigned int' arguments
 #define PRINT_INF(format,...)  printf( "Inf [%s():%d] "format, __FUNCTION__, __LINE__, ##__VA_ARGS__)

编译器版本

arm-himix200-linux-g++ (HC&C V1R3C00SPC200B005_20190606) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

#define PRINT_ERR(format,...)  printf( "Err [%s():%d] " format, __FUNCTION__, __LINE__, ##__VA_ARGS__)

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!