C++11 error:unable to find string literal operator ' operator ' __c++

Source: Internet
Author: User
c++11 error:unable to find string literal operator ' operator '

A simple macro C + + #define Log_information (x, ...) Log_me ("%s:%d," x, __function__,__line__, # #__VA_ARGS__)

1 #define LOG_INFORMATION (x, ...) Log_me ("%s:%d," x, __function__,__line__, # #__VA_ARGS__)

Can compile normally, but when C++11 is enabled, the report compiles error C + + complier the error Shell error:unable to find string literal operator ' operator ' "X '

1 Error:unable to find string literal operator ' operator ' "X '

Online search, said is c++11 requirements, when the string and variable connection, you must add a space to do. So simply modify it as follows. C + + #if __cplusplus < 201103L #define Log_information (x, ...) Log_me ("%s:%d," x, __function__,__line__, # #__VA_ARGS__) #else #define Log_information (x, ...) Log_me ("%s:%d," x, __function__,__line__, # #__VA_ARGS__) #endif

1 2 3 4 5 #if __cplusplus < 201103L #define Log_information (x, ...) Log_me ("%s:%d," x, __function__,__line__, # #__VA_ARGS__) #else #define Log_information (x, ...) Log_me ("%s:%d," x, __function__,__line__, # #__VA_ARGS__) #endif

Note: The version of GCC used in "android-ndk-r10e", GCC-4.9 prior to the release of the "__cplusplus" Macro definition error problem, you need to refer to "NDK under GCC definition __ Cplusplus incorrect problem ", upgrade GCC to 4.9

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.