Question:
Compiling/Running C programs in Linux-Ubuntu?
Don E
2007-06-17 16:36:09 UTC
I just installed Ubuntu on my laptop and want to know where to write, how to compile, and how to run programs written in C. I also don't have internet access, so is there a way I can write, compile, and run C programs in Ubuntu? Thanks a lot.
Four answers:
junglejungle
2007-06-17 16:41:27 UTC
you don't need to go online to make programs, as long as you installed the compiler no problem



depends what c envoirnment you want to .e.g. the old style compiler , or the one in kde etc..



go out to shell



emacs program.c

make ya program

save it..



to compile



gcc -c program.c



it will produce a.out



to run >



a.out



depends what envoirnment your using to be honest.
mcgruder
2016-09-28 03:46:05 UTC
i exploit Code::Blocks with Ubuntu purely approximately solely for C/C++ initiatives. My purely grievance is that its source code reformatting is susceptible. I assume you may launch a compiler from nano, yet once you will use a textual content textile editor fairly of an IDE, then emacs is a lot greater effectual and continues to be the top-rated for a programmer's textual content textile editor. For an incredible source, evaluate commencing up Linux Programming (4th ed.) via Matthew and Stones. It covers an incredible sort of floor, from shell programming to programming purposes or perhaps gadget drivers in C. No examples in C++ (no longer interior the third version that I very own, besides) yet it is not important. Linux/Unix gadget calls are no longer merchandise oriented, so as that the header records and the calling syntax is precisely the comparable in C++ as in C.
Rose D
2007-06-17 16:38:31 UTC
You just do your coding in the editor of your choice (I prefer emacs, but it's up to you). The default compiler is gcc, which should be included. Type 'man gcc' for info on using it.
2007-06-17 16:37:55 UTC
Sure. Just go ahead and write away - you'll have everything you need already! Any text editor will do, and you can use gcc to compile :)


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...