Thread: How to run a program

  1. #1
    Registered User
    Join Date
    Dec 2013

    How to run a program

    Hi guys,

    Feel a bit of an idiot, but I have just done the helloworld program using emacs on my mac, it seems to have compiled, but I can't seem to run it from the terminal.

    I have my helloworld.cpp source code file in there and I have compiled it as hello, which is also there, but I can't work out how to run it. I thought it was:
    but no luck, I have tried

    but that doesn't work either, how do I get this to run please?

    Kind regards

  2. #2
    Informer -Adrian's Avatar
    Join Date
    Jan 2013
    Hello Rob, you just have to type the name of the executable itself.

    Example in terminal:
    clang helloworld.cpp -o robsprogram
    That should do the job. Let us know if that doesn't work for you.

  3. #3
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Are you sure the current directory is that in which the executable is?
    Are you sure you type the name of the executable correctly?
    Also, your antivirus may be blocking the program, try disabling it for a minute and see what happens.
    Devoted my life to programming...

  4. #4
    Registered User
    Join Date
    Dec 2013
    Thanks -Adrian, that's the one, I feel like a bit of an idiot.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 09-09-2014, 02:36 PM
  2. Replies: 2
    Last Post: 12-11-2012, 12:25 AM
  3. Replies: 1
    Last Post: 03-03-2009, 04:47 PM
  4. Replies: 5
    Last Post: 08-16-2007, 11:43 PM
  5. Replies: 18
    Last Post: 11-13-2006, 01:11 PM