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

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

  1. macrumors newbie

    Feb 28, 2007
    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?

    Jenny xx

    P.S. If this makes any difference, here is my 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);
  2. Administrator


    Staff Member

    Feb 5, 2004
    New Zealand
    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


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

Share This Page