c++ 宏定义包含双引号编译错误

宏定义如下:

#define    RBRAND  "test"
#define    VER  "1"
#define    BRANCH  "A"
#define    CAMERA_VERSION RBRAND"_"VER"_"BRANCH

编译: C ++11提示错误

 invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix]

修正方法:
makefile中编译选项加上如下参数:

 CXXFLAGS  = -std=c++11 -Wno-literal-suffix 
发布了95 篇原创文章 · 获赞 14 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/ding283595861/article/details/103718871