Correct import/export of symbols from library

I strongly recommend you take a look at the GenerateExportHeader module. It automates this sort of logic and it supports a wide range of toolchains.