7

I have had experience using Visual Studio till now. But I am intending to use a few Linux tools to develop and maintain applications which are written in C.

I went thorough this question but it talks too much about the IDE's. I am happy to use them but I wanted to know which other tools are handy and important for the above excercise. I would also like to know incase there are any commands which would make things easy. Thanks!

EDIT: I have used vim and familiar with gcc and its important flags. anything further would help.

Community
  • 1
  • 1
Shash
  • 4,160
  • 8
  • 43
  • 67

4 Answers4

11

You will want to familiarize yourself with the linux command line tools. In particular:

  • Learn a good editor such as vim or emacs
  • Script your builds using make
  • Compile using gcc
  • Debug using gdb
  • Source control: if you have the luxury of choosing one, I recommend a modern DVCS such as git or mercurial. Otherwise whatever tool your team is already using should be fine.

This is just scratching the surface of the essentials, but it may help you get started.


These tools are also very useful:

  • grep - You need a good way to search through source files. This command is integrated with vim and emacs (?) so you will probably want to use it directly from your editor in most cases.
  • ctags - As others have said, this will make it much easier to navigate through your source code from your editor. Again, consult your editor for exactly how to work with ctags.
  • valgrind - To find memory leaks in your application.
  • lint - A static analysis tool such as splint to find coding mistakes in your C code.
  • rpm or another packaging system - Depending upon how you will deploy your application, you may want to use a package manager to help with versioning, install/upgrade scripts, etc.
  • screen - A terminal multiplexer allows you to split up your terminal so you can (for example) look at your source code in one pane and debug/execute/search logs in another. This is also handy if you have to connect to any remote machines your are supporting, since if you happen to get disconnected you can just reconnect to your remote screen session later, without having to worry about all of your commands being terminated. For example, if you are in the middle of a yum update you do not have to worry about it being terminated mid-transaction just because your connection was severed.
  • ssh / sftp / etc - To securely copy files to your test/production machines, if necessary.
Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
6

This tools are useful when developing in C under Linux:

  1. IDE : Vim with solarized theme (http://ethanschoonover.com/). Ctgas and Taglist to navigate easily through your code(http://www.thegeekstuff.com/2009/04/ctags-taglist-vi-vim-editor-as-sourece-code-browser/)
  2. For compiling and dubugging gcc, gdb, make
  3. For big projects : AUTOCONF, AUTOMAKE, and LIBTOOL
  4. To check for all memory related stuff : Valgrind To check functions CPU time consumption Callgrind (http://valgrind.org/info/tools.html) And globally Valgrind's Tool Suite (http://valgrind.org/info/tools.html) is a great tool
  5. For high quality code : GNU gcov(Test coverage), this is a great article on code testing and high quality C code (http://aleccolocco.blogspot.fr/2009/08/sqlite-lesson-in-low-defect-software.html)
  6. GNU locate : To find easily all files
  7. Git for source code configuration
  8. Doxygen : to generate documentation for the code
  9. If you develop network programs : wireshrak, tcpdump
  10. Esaily navigate through kernel code with LXR(http://lxr.linux.no) (http://www.ittc.ku.edu/~niehaus/classes/800-s04/notes/setup_lxr.txt)
  11. Strace to trace system calls(It is always a good tool to debug programs that open configuration files)

MAN PAGES is the best tool

And a lot of other good stuff :-

TOC
  • 4,326
  • 18
  • 21
2

Using terminator for multi terms and easy switch while using processus or htop.

I recommend emacs (-nw) or vi

Gcc to compile your C code.

You also want to use GDB for debug.

Valgrind to check leak and memory dump

C404
  • 243
  • 4
  • 14
1

You need to be able to find stuff in your codebase, and for that I'd recommend:

  1. ack. It's like a find/grep combination, but much easier to use, much more useful and geared directly towards programmers.
  2. ctags. It will help you navigate through your codebase via your editor (vi/emacs etc.) in a asimilar fashion to IDEs (treating code as a set of hyperlinks)
Brian Agnew
  • 268,207
  • 37
  • 334
  • 440