Loading a library from a script

Also, what do I need to do so that I can recall the same macro multiple times? Currently it crashes with warning of ‘unknown types’ when calling it more than once:

[0] .x macro.C
Success!
[1] .x macro.C
... error: unknown type name 'foo' ...

EDIT: I tried wrapping the library loading in a header guard, but that didn’t resolve the issue.