compiling problem

Discussion in 'Mac Programming' started by mogallin, Aug 20, 2010.

  1. mogallin macrumors member

    Jul 21, 2008
    Iv'e written a piece of c++ code (a command line tool) in Xcode which runs fine within Xcode and the terminal file at project/build/release also runs as it should. However, when I move this file to my laptop and try opening it in terminal all I get is a message saying something like "Permission denied". The program don't start.

    Moving the project to the laptop and building it it runs fine on the laptop but not on the desktop.
    Both computers run OS 10.6.4 and Xcode 3.2.

    How should I do with Xcode or other software to get a file which I can run on different computers without compiling it on each one of them?
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
  3. Hansr macrumors 6502a

    Apr 1, 2007
    Chmod the binary to be executable by the user.
  4. mogallin thread starter macrumors member

    Jul 21, 2008
    Thanks for the answers.

    The chmod-thing worked perfectly.

    Do you know of any way to make these permissions stick so that one will not have to change the permissions every time the program is moved to a new computer?
  5. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
    Not in the file itself. The permissions are metadata stored in the filesystem. If you use a file system that doesn't understand them (FAT32/CD-ROM/e-mail,...) you will lose them.

    You could package the app in a tar/zip/dmg file with the right permissions and unpack it that way on the machines you distribute to.

  6. mogallin thread starter macrumors member

    Jul 21, 2008

Share This Page