really, really dumb c question

Jump to First Reply
Posted:
in Genius Bar edited January 2014
We're talking very basic here...



I've got a helloworld program written:



#include <stdio.h>



main()

{

printf("hey there\

");

}



and compiled with gcc thusly:

gcc -o hello hello.c



But I get a "command not found" error when I try to execute hello. What completely obvious thing am I missing here??



o'o'a'a

Comments

  • Reply 1 of 4
    airslufairsluf Posts: 1,861member
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 4
    odlundodlund Posts: 2member
    [quote]Originally posted by o'o'a'a:

    <strong>

    But I get a "command not found" error when I try to execute hello. What completely obvious thing am I missing here??</strong><hr></blockquote>



    It's possible that you don't have your current working directory "." in your $PATH so try starting the program with ./hello instead of just hello
     0Likes 0Dislikes 0Informatives
  • Reply 3 of 4
    o'o'a'ao'o'a'a Posts: 13member
    [quote]Originally posted by odlund:

    <strong>



    It's possible that you don't have your current working directory "." in your $PATH so try starting the program with ./hello instead of just hello</strong><hr></blockquote>



    Bingo. Duh.



    Anyway, thanks! I really appreciate the help.



    o'o'a'a
     0Likes 0Dislikes 0Informatives
  • Reply 4 of 4
    classic question
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.