1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Xcode program won't run on any other mac besides mine

Discussion in 'Mac Programming' started by Jennygrrl, Mar 23, 2007.

  1. macrumors newbie

    #1
    Hi everyone

    I wrote a C++ program and compiled it in xcode. It runs, but only on my Mac. I think this might be because i have the xcode tools installed but my other Mac doesnt (They are both Intel macs).

    Does anyone know how i can get my C++ program to work on another Mac without the dev tools? You can do this with Visual basic on Windows, so why not on a Mac?

    thanks!
    Jenny xx

    P.S. If this makes any difference, here is my code:
    Code:
    #include <stdio.h>
    
    int main()
    {
    	int num1, num2, num3;
    	int sum;
    
    	printf("Please enter the first number: ");
    	scanf("%d%*c", &num1);   
    
    	printf("Please enter the second number: ");
    	scanf("%d%*c", &num2);
    	
    	printf("Please enter the third number: ");
    	scanf("%d%*c", &num3);
    
    	sum = num1 + num2 + num3;
    	
    	printf("The sum of the three numbers is: %d\n", sum);
    
    	return(0);
    }
     
  2. Administrator

    HexMonkey

    Staff Member

    #2
    You need to change the build configuration. Choose Project > Set Active Build Configuration > Release then rebuild and it should work. The Debug configuration allows you to debug but will only work on the computer it's built on.
     
  3. macrumors G4

    Eraserhead

    #3
    This really needs to be a sticky, it comes up so frequently.
     

Share This Page