declarations in libraries

IMHO you should not declare variables in .h files.