views:

205

answers:

8

How do I set up a non-IDE-based C development environment on Linux?

+12  A: 

gcc + make + vi and you will live happily ever after!

Vitor Py
Make doesn't make me so happy...
Cogwheel - Matthew Orlando
Have you tried `make happy`? :)
Nikolai N Fetissov
Make is the worst build system, except for all the other ones.
Carl Norum
Omg I couldn't agree more. Make is awful, but it's so much better than everything else. Same goes with gdb on Linux.
Matt Joiner
where are you all EMACS junkies? the boy is being baptized (VI).
Gollum
cmake is decent.
Computer Guru
+1  A: 

If you're not a masochist:

gcc + cmake + nano ;)

Make sure to edit your .nanorc file (you can copy an example from /etc/nanorc generally)

Brendan Long
CMake is masochism, sorry.
Matt Joiner
@Matt Joiner, not as bad as make :D
Brendan Long
+2  A: 

Okay, someone's gotta say it: Emacs, gcc, and make.

If - as a commenter suggested - you're looking for instructions on setting this up, there's probably no set up needed, as most Linux distributions I've used come with these programs already installed.

GreenMatt
This is why I can't sleep at night.
Matt Joiner
If someone can't sleep at night because some other person somewhere might be using emacs, then the first person really needs to learn to appreciate how good they've got it and to live and let live ...
GreenMatt
-1 for Emacs... Only kidding. It has been said that Emacs is an excellent operating system, all it needs is a decent text editor. Fortunately, you can now get a vi emulator for it.
JeremyP
A: 

Emacs + Cedet is the best

shk
+2  A: 

Okay my environment:

Geany or gedit, make, GCC. If I have to code on the command line I'd probably go with vi or nano over emacs, I just can't cope with emacs anymore.

Matt Joiner
+1  A: 

I use gtkemacs, gcc, make but more often scons these days.

This question is dangerously close to inciting religious wars. Let me get it started: All configurations other than mine are inferior.

jcoffland
+6  A: 

A pretty good development environment is most likely already there--no setup necessary. This is because most Linux installations are GNU/Linux. GNU provides all the pieces you need for C software development.

Use the 'which' command to make sure these programs are in your execution path

which gcc
which make

Gcc is your compiler. Make lets you define the compiling and linking steps. (It can call gcc for you.)

You are likely to have several editors installed such as vi, nano, and GNU emacs. To see if you have emacs (for instance), type

which emacs

If the which command returns a valid path (i.e. it doesn't say which: no emacs in ...) then that means you can run the program just by typing its name:

emacs

for example.

GoalBased
I believe on Ubuntu you need to `apt-get install build-essential`. On Arch, it's `pacman -S base-devel`. Not sure about other distros.
Brendan Long
Appreciate that Brendan; I think that's the type of information he's looking for.
GoalBased
A: 

I would recommend gcc + vim/vi + (make).

Vim/vi is almost impossible to "just pick up and use" because it will be completely foreign and you will struggle to even move the cursor or insert text, but fortunately, Vim comes with an extremely helpful tutor you can start by invoking the command vimtutor in the shell. It will get you up and running in no time!

While Vim's interface is really bizarre and esoteric at first, once you get used to it (shouldn't take very long once you finish vimtutor), you will see your productivity when editing code increase dramatically!

chisophugis