1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Rep Power

    Xcode Error using C++ command


    Stuck using xCode here until I can find a PC to mess around on Visual with. In any case, I've been getting along just fine, but the last two things I tried I've been getting this error here:

    0x7fff8fe166cd: movdqa %xmm0, 64(%rsp) Thread 1: EXC_BAD_ACCESS (code=13, address=0x0)
    0x7fff8fe166d3: movdqa %xmm1, 80(%rsp)
    0x7fff8fe166d9: movdqa %xmm2, 96(%rsp)
    0x7fff8fe166df: movdqa %xmm3, 112(%rsp)
    0x7fff8fe166e5: movdqa %xmm4, 128(%rsp)
    0x7fff8fe166ee: movdqa %xmm5, 144(%rsp)
    0x7fff8fe166f7: movdqa %xmm6, 160(%rsp)
    0x7fff8fe16700: movdqa %xmm7, 176(%rsp)

    My project looks like this:

    // input and output example

    #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;
    return 0;

    What happens is, I get as far as entering my integer in, and I make sure it's an integer within the correct range. After that, the thing fails.

    Basic stuff really, brushing up / learning a bit... Can't seem to figure out what's going on, and google has left me with nothing really to go on. I read something about aligning the stack to be 16 byte aligned since I'm on a Mac using C++ in Xcode, but I have no idea how to go about something like that, or what it means.

    Anyone familiar with this / have a solution? Thanks in advance.

    Sorry, I don't know if it helps, but I'm using a MBP from Feb 2012 running on OSX Lion 10.7.4 and the version of Xcode is 4.4.1.
  2. #2
  3. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Rep Power
    Use code tags when you post code, please.

    There's nothing wrong with the code as you've written it. It's got to be some sort of Xcode installation problem.

    I'm on the same version (older MBP), I'll see if I can reproduce. Don't usually use Xcode.

    ETA: Nope, works OK for me.
    Last edited by ptr2void; August 25th, 2012 at 05:01 AM.
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Rep Power
    Sorry about that, will do for the future.

    Hmm alright. Is there a better program to code with C++ on a Mac? In any case, I guess I'll keep trying different things to see if I can't figure it out.

    If any one else has any idea, let me know! Thanks again.

IMN logo majestic logo threadwatch logo seochat tools logo