Question: I need to monitor a directory for new files that are added (constantly: one or two every 5 seconds are added and deleted).

It would be nice to tail them constantly in terminal, but since this seems unlikely, it would be also good to append all of the tails to a file. That way when I stop my process I can review all of the files that were added and deleted (I need the contents not the filename).

A shell script will work as well as long as it will run on Mac OSX Lion.

Any help? I've tried multi-tail and tail -f (but these don't monitor the directory for new files).

Answer: 
Two errors listed - you need a space after the first `#ifndef`, and it seems that your compiler couldn't find the SDL header file(s) - maybe they're not installed, or you need a -Ipath/to/SDL/include compiler option so it looks in the right place.
First, you'll probably want to ensure that you SDL installed to begin with. I'm not going to waste your time walking through all that distribution specific stuff. I'm going to assume you know what you're doing. After you fix the typos, you could potentially use pkg-config. It's invoked on the command-lind by typing:

```
$ g++ source.cpp -o program `pkg-config --cflags --libs sdl`

```

\*\* Note the use of ` instead of '. Of course, the -o flags and all that jazz I'm sure you're familiar with. pkg-config adds the appropriate flags to the command line so that you don't have to worry about manually listing all the necessary command-line arguments. Of course, the availability of all the \*.pc files will vary by distribution, but using Ubuntu 12.04, the above command works. In my experience, pkg-config is appropriately tuned to work on your system no matter what distribution. If you'd like to see what's actually going on under the hood, simply type:

```
$ pkg-config --cflags --libs sdl

```