- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When is _MSC_VER defined in 2013 version of the C++ compiler ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
_MSC_VER is always defined whenever you are using our Windows based (icl) compiler. It is set to whatever version of the Microsoft compiler is in your PATH.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
_MSC_VER is always defined whenever you are using our Windows based (icl) compiler. It is set to whatever version of the Microsoft compiler is in your PATH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Sergey
How are those header files named?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as I can see, MSC_VER is not defined in the Microsoft headers, although many of them check the value. The presence of a definition is often used to determine that Microsoft CL is present.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim is correct. _MSC_VER is predefined by the compiler, not in any header. You can see this with this simple program where cl is pointing at MSVC++ 2008 (microsoft_version 1500):
!% cat t.cpp
_MSC_VER
!% icl -E t.cpp
Intel(R) C++ Compiler XE for applications running on IA-32, Version Mainline Bet
a Build x
Built Nov 20 2013 11:49:27 by jward4 on JWARD4-DESK in D:/workspaces/cfe/dev
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.
t.cpp
#line 1 "t.cpp"
1500
!%
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for badly formulated question.
I wanted to ask what is the name of those header files which were mentioned in your post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have found the needed info on MSDN.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page