I have made my first "Hello, world", in c and py(with help), but I can't "play" them, or see if they work. I know you have to open the terminal, but what then.... :?:
I use Ubuntu. 8)
Printable View
I have made my first "Hello, world", in c and py(with help), but I can't "play" them, or see if they work. I know you have to open the terminal, but what then.... :?:
I use Ubuntu. 8)
First you have to compile it and then run it.
gcc -o program program.c
chmod +x program
./program
Unfortunately there is no Gnu C compiler in Ubuntu 8). You'll have to install it.
I'm just getting into bash, maybe perl is for later :).
Through Synaptic, search for gcc and install that. Then, do what serz mentioned.
Bryan
I suggest another distro. Ubuntu isn't really meant for peope that want to program; it's meant for "regualr people". Anyone that has good experience with Unix doesn't like it.
Is it just me or isn't the chmod +x program step uneccesary. I have never experienced that gcc does not make the output file executable automatically. (?)Quote:
Originally Posted by serz
I usually just:
I never have to chmod.Code:gcc foo.c -o foo
jens uses it, and he's got pretty good experience with UNIX. If you get into Ubuntu, it's great for some people. IMO it sucks, just a half-assed debian deriative.Quote:
Originally Posted by a thing
I've not used Ubuntu, but seeing as how gcc and make are quite installable, I fail to see how this matters at all. SuSE doesn't have them by default either, but they can be obtained.
Anywho, to sum everything up:
If, for some reason, this still doesn't work, then can you post the output of:Code:apt-get install gcc
gcc -Wall -o foo foo.c <-- "-Wall" enables warnings
./foo
Where foo.c is the name of your source file?Code:ls -l foo.c