Basically, /GS switch provides at runtime basic protection against some types of buffer overrun attacks. On functions that the compiler thinks might be subject to buffer overruns, the compiler inserts a security cookie before the return address. The security cookie is computed once at module load and its value is pushed to the stack on function entry. Then, on function exit, the compiler helper is called to make sure the cookie's value is still the same. If the value was changed, this is treated as a sign of a buffer overrun in the stack corruption.

To fix this problem you need to link your code to bufferoverflowU.lib. This should do it for most of applications out of there.

Just do

cl.exe a.cpp bufferoverflowU.lib

or

link a.obj bufferoverflowU.lib

This is problem-resolution type of post. I am working on a KB article on this that should be published sometime soon. It will have all details on what library and why you need to link with.