Neither #pragma once nor include guards (#ifndefs) can protect you against linker errors! They're only useful during the compile, not the link.
In general, non-template functions and variables cannot be defined in a header file or else you're likely to end up with this error. You should put them in a cpp file, and if necessary in the case of global variables, extern-declare them in the header.
There are a few other options as well. Declaring functions inline usually allows them to be placed in the header. Declaring variables static works the same way (but may be misleading, because each translation unit will have a different version of the "global" variable!). Singleton classes, classes with static members, etc are also options.