Linux port + bugfixes

This pull request contains 6 changes:

The first 4 are generic bug fixes mostly relating the linux and/or gcc.

The last 2 add linux support.  This includes moving he resources for the
sample out of the proj.win32 folder.  Any reason you don't have a proj.marmalade
for the sample?