Basic questions on writing a Unix Service (newbie help!)

Hi there.

I've got 12 years experience writing C++ on Windows, and 3 years C# on Windows. Now my boss wants me to write a C++ app to run on Unix as a multithreaded 'service' (i.e. a program that runs with no user intervention).

Some quick questions for The Experts:

  • Whats the best C++ compiler to use? I'm happy with ANSI compliant stuff.
  • Whats the best editing/IDE environment to use? Please don't say VI as it's UI makes me ill. Something as close as possible to VS2005 would be nice :rolleyes:
  • Is there a special name for a service on Unix? :confused:
  • Where would I start in writing a TSR type app (i.e. one that runs in the background on Unix)

Some good 'Unix programming for beginners' literature/websites wouldn't go amiss either.

Thanks in advance!
Gizz. :slight_smile:

  1. use POSIX (it's also ANSI) compliant compilers
  2. You can write code on a PC, then ftp it to UNIX. You will have to learn basic shell commands. In that mode I use UltraEdit.
    3.service=daemon
  3. You have to learn something about UNIX system calls (like Windows API) and UNIX processes in general.

This gives you a lot of background and is a free download:
http://www.advancedlinuxprogramming.com/
Don't worry too much about it being linux. 98% of the material works anywhere.

This shows how to write a service (daemon) read the "book" above first.
http://www.erlenstar.demon.co.uk/unix/faq_2.html\#SEC16

Thanks Jim, thats just about spot on! (Always wondered what a daemon was...!!!)

Best compiler is always subject to argument, but the freest, most common, and easiest to get is gcc.

The best development environment is not vi. I hate it as much as you do. ...I use nano. :stuck_out_tongue:

I remain amazed at the effort people will wring themselves through in order to type text in a white window instead of a black one! The best development environment I know of is the raw makefile; if you have gcc and make, you have everything you need.

If you don't understand makefiles you'll probably find graphical UNIX development environments hell, since they're by and large shells on top of makefiles. See KDevelop.