Add static generator

Close #163
It will not segfault but generate a compilation error.