Could you test if it works when not in debug? By compiling a release (as an example)?
If it works without debug, I suppose it could have something to do with the debugger or the linker.
Check the linker syntax, to be sure it is -Wl,--enable-auto-import
You can find those options here;
"Settings" -> "Compiler and debugger..."
"Global compiler settings"
"Linker settings"
Like NathanOlivier said, you should try to add an exclusion for your "\Visual Studio 2015\Projects" directory for Avast.
Running my C++ code gives me a blank console (See the solution by Blastfurnace)