compiling problem

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

  1. mogallin macrumors member

    Joined:
    Jul 21, 2008
    #1
    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

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
  3. Hansr macrumors 6502a

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

    Joined:
    Jul 21, 2008
    #4
    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

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #5
    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.

    B
     
  6. mogallin thread starter macrumors member

    Joined:
    Jul 21, 2008

Share This Page