Xcode "run" is disabled

Discussion in 'Mac Programming' started by elodouwen, Mar 8, 2014.

  1. elodouwen macrumors newbie

    Joined:
    Mar 8, 2014
    #1
    hi
    i am beginning with Xcode
    i have typed a simple C program in a main.c file, itself in a .xcodeproject file
    i have also typed a very simple Python program in a .py file
    when i try to "run" these files, i can not because the "run" menu item is disabled
    i can not manage to find on google neither on any forum any answer to my problem
    could anyone help ?
    thanks
    Vinz
     
  2. Blakeasd macrumors 6502a

    Joined:
    Dec 29, 2009
    #2
    Go to:

    Product > Scheme > Manage Schemes.

    Do you see anything in red?
     
  3. elodouwen thread starter macrumors newbie

    Joined:
    Mar 8, 2014
    #3
    hi
    thanks
    it is empty

    since my message i have found en explanation on internet about how to create a pyhton Xcode project from the beginning

    so i can find a solution for the .py file, i copy past it in a new theorically working python Xcode project
    except that a new problem appears :
    i was told to do this :
    but the file python3 at this step is not clickable, only python3.3-32 is
    at the end, when making "run" it does not work :
    Code:
    Xcode cannot run using the selected destination.
    Choose a destination with a supported architecture in order to run on this system.
    
    for the C Xcode project i confess i feel lost
    the scheme is not empty and nothing is red but the compilation failed, and i do not find why, it does nt seem to be a code error but a "scheme" error

    is there not an internet page where i can find simple instructions to complete schemes in order to begin learning programming ?

    thanks for your reply !

    Vinz
     
  4. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #4
    If you are making easy programs while learning programming, I would avoid Xcode. Xcode saves time when making full iOS or Mac OS Cocoa apps. But for simple command-line programs, my opinion is that it adds complexity you don't need.

    You can use Xcode as your text editor then just directly execute the programs in the Terminal app. In Terminal, cd to the directory where you programs are. Python is easy, just 'python program.py'.

    C programs must be compiled first. Make sure you have the Xcode command-line tools installed. That option is in the preferences panel in Xcode. Once the tools are installed.

    gcc -o hello hello.c
    ./hello

    The first command compiles the C program (in this case hello.c). The second command executes it.
     
  5. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #5
    Yes for languages other than obj-c (and maybe C++).

    But for a CML objc-c app, just start a new "command line tool" project and replace the Hello world line by your own code.
    Xcode takes care of the compilations and build settings. This does simplify things. I have no idea how to build a "make" file for example and I am not going to spend time on finding out. Xcode takes care of such things very well.
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    make has a number of builtin rules. If there's a "foo.m" in the working dir, and no makefile, what does 'make -n foo' say? The -n option tells make to just emit the commands, rather than running them.
     
  7. elodouwen thread starter macrumors newbie

    Joined:
    Mar 8, 2014
    #7
    hi and thanks for the answers
    - python works well now either with command line in the terminalfor python 2.7 or 3.3 either with the IDLE of python for python 3.3 (IDLE of python 2.7 not working)
    - the instructions i founded on internet and followed to configure Xcode for Python does not work when i have to choose the executable when organising the "scheme"
    - for C now, i founded one preference in Xcode dealing with command line, it says : "command line tool = Xcode 5.0.2 (5A3005)". But, now, if i cd to the folder where the .c is, then i type dcc -o file.c file it answers "gcc = command not found"
    - and if i open a new C project, i dont find any "command line tool" blank project, i just have choice between "ios apps" and "mac apps" (and what about buinding apps for other systems ?) and in "mac apps" i can choose a C file. I guess that the fact that "run" is then disabled would n't occur if had found "command line tool" in the models proposed bu my Xcode
    Vinz
     
  8. Dranix macrumors 6502a

    Dranix

    Joined:
    Feb 26, 2011
    Location:
    Gelnhausen, Germany
    #8
    Here how the dialog after choosing create new project should look and the details that come after it:
     

    Attached Files:

  9. elodouwen thread starter macrumors newbie

    Joined:
    Mar 8, 2014
    #9
    Here how the dialog after choosing create new project looks
    à jeter.png
    i begin to understand that there maybe be a problem with the version of Xcode
    i have an older version of Xcode on an older mac and the window for new projets look like your picture.
    the question is, so : what model should i choose among the models proposed by Xcode 5 ?
     
  10. Dranix, Mar 10, 2014
    Last edited: Mar 10, 2014

    Dranix macrumors 6502a

    Dranix

    Joined:
    Feb 26, 2011
    Location:
    Gelnhausen, Germany
    #10
    That is strange. I have the exact same version of Xcode5. Freshly installed on my virgin nMP when it arrived - so no old baggage from old install left over.

    Did you by any chance install some template packs?

    Edit: I think I found the problem. What you have opened is the "new file" dialog. You need the "new project" for creating new projects. New file is used to add elements to an already existing project like additional classes.
     
  11. elodouwen thread starter macrumors newbie

    Joined:
    Mar 8, 2014
    #11
    thanks, for the time spent for me ! i was always afraid for very technical errors, and that was very simple indeed
    now i can start
    see you soon on this rich and cool forum
    Vincent
     

Share This Page