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 4082998
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:15:26+00:00 2026-05-20T18:15:26+00:00

I have just upgraded to Xcode 4 and am working in C++ project. I

  • 0

I have just upgraded to Xcode 4 and am working in C++ project. I am finding that printf() intermittently fails to complete printing (mid-line) to the Xcode console, and from there on printf() ceases to print anything – even though the application continues to run in debugger.

I suspect Xcode 4’s console window is at fault because if I redirect stdout to a file, then logging seems to continue without any problems. That said, if I use following on command line:

tail -f log-out.txt

then there are times when incomplete lines are shown. But this is probably due to some sort of buffering (incomplete flush) because ultimately the lines are complete in the file.

So, I am wondering if anyone has experienced something like this and has an understanding of what’s causing freeze in Xcode’s console output.

  • 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-05-20T18:15:27+00:00Added an answer on May 20, 2026 at 6:15 pm

    This behavior seems to be intermittent and reportedly pre-exists Xcode 4. As a work-around I did something like this to the main() function. There are some advantages to this approach when Xcode’s Debug Console is misbehaving.

    #define REDIRECT_STDOUT_TO_FILE 1
    
    int main(int argc, char ** argv)
    {
    #if REDIRECT_STDOUT_TO_FILE //## redirect stdout to "log-out.txt"
        freopen("log-out.txt", "w", stdout);
    #endif  //  REDIRECT_STDOUT_TO_FILE
    
        MyApp app(argc, argv);
    
        int result = app.Run();
    
    #if REDIRECT_STDOUT_TO_FILE //## redirect stdout to "log-out.txt"
        fflush(stdout);
        fclose(stdout);
    #endif  //  REDIRECT_STDOUT_TO_FILE
    
        return result;
    }
    

    Using tail -f log-out.txt in Terminal allows one to view stdout output. Or, if you use BBEdit, bbedit –new-window log-out.txt is also an workable solution.

    For now, I am considering this a bug in Xcode – and I will continue trying to understand under what conditions it occurs.

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

Sidebar

Related Questions

I just upgraded to Xcode 4. I have a project that is still dependent
I have a C# 4.0 Winform app that I just upgraded from 3.5 to
I am trying to learn iphone programming and I have just upgraded xcode to
I just upgraded Xcode, but now I don't have any 3.x SDK for Simulator.
I have just upgraded XCode 3.x to 4.0 and ran into following build error.
I have recently (e.g. just now) upgraded to XCode 4, and I like it
I have just upgraded our company's domain controller from NT 4.0 to Windows 2008
I have just upgraded my server 2003 to serrver 2008. As I write this,
I have just inherited a server application, however it seems that the only copy
While working on an Xcode project i keep getting the spinning wheel while switching

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.