I would like to know why the Visual C++ compiler gets me an warning/error if I use the following code:
#pragma message( "You have " _MSC_FULL_VER )
Here is what I get:
error C2220: warning treated as error - no 'object' file generated
warning C4081: expected ':'; found ')'
The problem reproduces for _MSC_FULL_VER or _MSV_VER but not if I try to use others like __FILE__ or __DATE__.
These macros are defined, they are documented on msdn
I think
#pragma messageneeds C strings only. IIRC,_MSC_FULL_VERis a number, while__FILE__and__DATE__are C strings. Try this(On a side note, this allows
which allows you to double-click on a message in VS’s output pane and be taken to its file/line.)