Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7722401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:09:45+00:00 2026-06-01T04:09:45+00:00

I am compiling my code with gcc 4.7.0. My code compiles fine with 4.6.1.

  • 0

I am compiling my code with gcc 4.7.0. My code compiles fine with 4.6.1. However with 4.7.0, it shows:

unable to find string literal operator ?operator"" PRIxPTR?

I have included proper inttypes.h file. If I try to redefine this, it complains that it is already defined.

Here is the erring code:

printf("%016"PRIxPTR" ", addr);

Can you tell the solution/workaround? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:09:46+00:00Added an answer on June 1, 2026 at 4:09 am

    Add a space before the PRIxPTR:

    printf("%016" PRIxPTR" ", addr);
    //           ^
    

    The reason is that since gcc 4.7, user-defined literals are supported in C++11 mode. One consequence is that "%016"PRIxPTR is no longer two separate tokens, and one may define (although GCC disallows that) a user-defined literal to do something strange e.g.

    size_t operator"" PRIxPTR(const char* input) { return strlen(input); }
    

    (If you are not using C++11 mode but encounter this error, please post a bug to GCC.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When compiling shared libraries in gcc the -fPIC option compiles the code as position
Greetings, SO. I have some code which I've made attempts at compiling using gcc,
I have written some code which compiles fine under linux but on Solaris I
I have a C++ class that compiles fine on linux with gcc and on
Take this non-compiling code for instance: public string GetPath(string basefolder, string[] extraFolders) { string
I'm trying to overload the dereference operator, but compiling the following code results in
Need help compiling in C. When using GCC at home (Windows, 3.4.5), the code
I have a problem while compiling my code ( undefined reference to 'yylex' ).
I have a small C++ library, compiles fine on Linux (which is my main
I have a project set up in MonoDevelop, it compiles and runs fine for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.