Use cstring for strdup etc.
Attempt to make compilable on Linux with shared db lib