why does xcode give me an error than says "exited unexpectedly lost connection" when i put in a cin>> input in c++
.
iMac, OS X Mountain Lion (10.8.5)
Apple Event: May 7th at 7 am PT
.
iMac, OS X Mountain Lion (10.8.5)
?
?
Could you post some example source code that can be used to reproduce this, please?
Which version of Xcode are you using?
Does it do this on every project? It looks like it is crashing when trying to read in the int. Did you start with a Command-Line Tool project using C++?
To save other readers from the typing, that C++ code is from a C++ tutorial project.
I've created an OS X command-line project and have loaded and tested that code on a 10.7 system running Xcode 4.6.3 (what I had handy); it all works as expected.
The release notes for Xcode 5 do reference a lost-connection error, as well.
yes and yes
Just tried the code MrHoffman pointed to
#include <iostream>
using namespace std;
int main ()
{
int i;
cout << "Please enter an integer value: ";
cin >> i;
cout << "The value you entered is " << i;
cout << " and its double is " << i*2 << ".\n";
return 0;
}
Tried it in Xcode 5 on a 10.8.5 system and it ran, both in Xcode and from the command line, fine.
Are you sure your project is a C++ command line project?
yes. Its on C++
Well as you can see it works ok, so somehting at your end is not right.
I'd start a brand new Xcode project (what version of Xcode, BTW?) cut and paste the code in to the main.cpp file and try it.
good luck
I don't think its the code. Its somthing with xcode. Ill try and reinstall xcode and see if that works
First have you tried the program from the terminal? It works there correct?
What kind of keyboard do you have, a wireless or a full keyboard with numeric keypad? After doing a search I hove found that the problem seems to be with using the Enter key in Xcode rater then the Return key.
The full keyboard with the numeric keypad has both an Enter and Return key. The Enter key is part of the Numeric keypad the Return key is part of the alpha kneeboard. Try using the Return key.
On the wireless keyboard (which I have) normal function of the key is Return but if you hold the function it sends Enter. If I run this code in Xcode and press the function to send a Enter I get the error.
In the terminal either key works fine so it is some weirdness in Xcode. Just use the Return key and you should be ok.
regards
OMG. Thank you so much. Holding the enter key worked.
why does xcode give me an error than says "exited unexpectedly lost connection" when i put in a cin>> input in c++