Launch compiled C++ file from terminal?

Discussion in 'Mac Programming' started by thestaton, Feb 6, 2008.

  1. macrumors 6502

    Joined:
    Jan 19, 2006
    #1
    Forgive my ignorance.

    I'm new to the programming world, but am progressing pretty quickly.

    Right now after I write my program I'm using the terminal to compile the program using...

    g++ programname.cpp -o programname.

    Everything works great. however I have to go to the folder that the file is in and double click it, in order for it to run.

    I've tried using the manual command from the terminal...

    programname ; exit;

    However I'm getting invalid command.

    So is there a way to go on and launch the file from the terminal to save a step?

    Thanks.
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
  3. thread starter macrumors 6502

    Joined:
    Jan 19, 2006
    #3
    thanks. worked like a charm :)
     

Share This Page