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?

![Screenshot from 2013-03-16 11:32:21](https://f.cloud.github.com/assets/515813/267244/d545e77c-8e6d-11e2-9720-b9a69e469e01.png)