Allow static getResource function generation

Static function generation might be useful when you want to use different resources accross different compilation units.

The second commit is mainly fixing some Linux issues.