It's a tough task, I think.
Take a look at this : http://msdn.microsoft.com/en-us/library/6y6t9esh.aspx
So, the linker uses the options and arguments defined in the "LINK
" environment variable.
So, I think this will work (not tested though):
(1) Create a system environment variable called "LINK" with value "/OUT <default_filename>".
(2) Inside your C++ code, change the LINK variable to "/OUT <default_filename_i>", where "i" is an index.
(3) Compile, I think the LINK variable will take care of the rest
SetLINKVar(i); // This func will change the LINK Env Var