Hi,
I have never done anything with any programing. I am trying to create the standard "Hello World" first program in C. Here is what happens:
1. I create the file in TextEdit and change it to plain text so I can save it as helloworld.c (have also used Text Wrangler and Xcode to create the file)
2. I open terminal and type:
gcc helloworld.c -o helloworld
3. Terminal says:
i686-apple-darwin11-llvm-gcc-4.2: try.c: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: no input files
I believe it is telling me the file does not exist? But it does. I have tried saving the .c file to multiple different locations all with the same outcome.
By changing my command to "gcc helloworld.C -o hello world" I managed to get terminal to say:
-bash: /Users/KevinsMacbookAir/Desktop/samp.c: Permission denied
(I could not repeat this outcome, which makes me think I probably
typed it wrong that time?)
I am sure I am being foolish somehow but have been trying different approaches for almost two hours. If this is as easy as it gets, programming may not be for me.
Any help is appreciated! Thanks.
EDIT: try and samp were other files I made following the same guidelines.
I have never done anything with any programing. I am trying to create the standard "Hello World" first program in C. Here is what happens:
1. I create the file in TextEdit and change it to plain text so I can save it as helloworld.c (have also used Text Wrangler and Xcode to create the file)
2. I open terminal and type:
gcc helloworld.c -o helloworld
3. Terminal says:
i686-apple-darwin11-llvm-gcc-4.2: try.c: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: no input files
I believe it is telling me the file does not exist? But it does. I have tried saving the .c file to multiple different locations all with the same outcome.
By changing my command to "gcc helloworld.C -o hello world" I managed to get terminal to say:
-bash: /Users/KevinsMacbookAir/Desktop/samp.c: Permission denied
(I could not repeat this outcome, which makes me think I probably
typed it wrong that time?)
I am sure I am being foolish somehow but have been trying different approaches for almost two hours. If this is as easy as it gets, programming may not be for me.
Any help is appreciated! Thanks.
EDIT: try and samp were other files I made following the same guidelines.
Last edited: