Can one of you geniuses out there help me please.
They say that compiling and running hello world is the hardest bit. They're right.
I've got debian on my laptop.
I read a so-called tutorial that reccomended

gcc hw.c

OK. So I get a file called a.out. Allegedly an executable.
Now how do I run it? I type a.out at the command line and get
bash: a.out: command not found

ls tells me that a.out does exist.
gui tells me that it has execute permission for owner, group and others

Any ideas.

Recommended Answers

All 4 Replies

That's because commands in the cwd are not in the PATH by default on Linux/Unix.

Type ./a.out Enjoy!

Thanks Duoas,
Your solution hit the spot.
DCL.

you should use gcc -o filename filename.c

this will produce a exe thats called filename instead of a.out

That's not really necessary if you are compiling something for you own use.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.