Is there any way to know if I’m compiling under a specific Microsoft Visual Studio version?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
_MSC_VERand possibly_MSC_FULL_VERis what you need. You can also examine visualc.hpp in any recent boost install for some usage examples.Some values for the more recent versions of the compiler are:
The version number above of course refers to the major version of your Visual studio you see in the about box, not to the year in the name. A thorough list can be found here. Starting recently, Visual Studio will start updating its ranges monotonically, meaning you should check ranges, rather than exact compiler values.
cl.exe /?will give a hint of the used version, e.g.: