0

I have a batch file that is executed as part of pre-build events in VC++ based project , within VS2012 IDE framework.The file , on error does following:

exit /B 0
:Error0
echo ****************************************************************************
set ErrorMssg="Attributes don't match"    
echo ****************************************************************************
exit /B 1

When executed from shell(wIn 7),it prints the error message correctly, when error condition is hit. However, from within Visual Studio, I only get error code, which i specified in the batch file:

error MSB3073: :VCEnd" exited with code 1

Is there a way for Visual Studio to actually print the reason for error,for example something like

error MSB3073: :VCEnd" exited with code 1: Attributes don't match

Thanks
sedy

user915783
  • 689
  • 1
  • 9
  • 27

1 Answers1

0

With the call to your pre-build batch file try redirecting stderr to stdout with 2>&1, see;

Community
  • 1
  • 1
Dave Anderson
  • 11,836
  • 3
  • 58
  • 79
  • Moreover, I can echo the error before exiting, but that shows on a different line than the line quoted above and i was hoping to append my error message to VS standard error message. – user915783 Aug 17 '15 at 22:51
  • @user915783 yes https://support.microsoft.com/en-us/kb/110930 but not exactly sure how that plays with the VS output window though – Dave Anderson Aug 17 '15 at 23:15