Forum Thread: Program Help Please....

ok so im trying to run the simple hello world! In kali linux, but when I try to open it, it say that the program is a directory heres a few picture so i can know what i am doing wrong......

Theres the file so you can see it on my desktop a.out

now this is the file thats inside the main.c

ok now heres my top of the line programing

ok and now when I try to open it I get this......oh by the way I cd / Desktop but for some reason my Kali linux doesn't show Desktop, but its in Desktop cause when i save things it pops up in Desktop any picture

any type of help will help thanks for taking your time in looking at this

18 Responses

You have to cd into the a.out and then compile and run the main.c file

so i would cd /a.out than gcc main.c right? but i keep geting this gcc: error: main.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.

Seems like you did not successfully cd into your Desktop directory and a.out is also a directory. Please follow the steps below and type it exactly as stated:

  1. cd ~/Desktop/a.out
  2. gcc main.c
  3. ./a.out

cd Desktop/a.out
gcc main.c -o helloworld
./helloworld

I no it looks like I didn't properly cd, but for some reason when I cd it doesn't show Desktop, but I no I cd into it cause of the / and also I have save files and they where on my desktop I think something is wrong with my kali and I'm going to have to reinstall it again fml......

When you cd, please do not put a space between the / and the Desktop/a.out.

cd /Desktop/a.out

it should actually be-->
cd Desktop\a.out

do it exactly as I showed your, no / after cd. So it is -->
cd Desktop/a.out
If that doesnt work try-->
gcc /home/root/Desktop/a.out/main.c

I think I'm going to have to reinstall again because I have been having a lot of problems with kali lately it keeps freezing and no certain things aren't working the way that they should I don't know what has been going on lately but when I had to install kali on my laptop which is only a month old so cant be laptop I have to re write the grub file because my laptop has UEFI firmware maybe this is why certain things aren't workings????

i have to otherwise it wont cd at all i will show you

wow lol !!!

Okay, that's certainly weird. Can you try prepending the tilde to the target directory?

cd ~/Desktop/a.out

Nothing weird there. You weren't trying to cd from the cwd. Instead you were cd'ing from /home/ I think. This happened because you had an / before Desktop.

ok let try it your way

VICTORY IS OURS!!!!!!!

THANKS GUYS I still have a lot to learn and I wish I had some one to teach me ,but this work thanks !!!!

it was the a.out that was throwing it off, but not to mention when i renamed the program. program the a.out when into the program file so now i have something like this I don't no how this happened

You compiled two different programs with the same main.c it seems. Meaning you ran gcc main.c -o a.out & gcc main.c -o program. Which means you can run ./a.out and ./program and both will give you the same output. You can just delete the one you don't want.

The fuck am I reading..... Reallly.... Da fuck.

Well his name was Donttrustme so you cant blame him.

Share Your Thoughts

  • Hot
  • Active