23

Can anyone tell me what compiler is built-in to Visual Studio 2015 for C++ projects? I tried it and tried older version compilers and it's giving me other compiling results. Is it GNU C++ version 4.8.2 or a newer version?

Guilherme Fidelis
  • 1,022
  • 11
  • 20
MaxDevelop
  • 637
  • 1
  • 4
  • 16

4 Answers4

40

They have their own compiler that goes by Visual C++ _____

Here is a mapping of the IDE version to the compiler version. They generally release a major compiler version with each major IDE version.

IDE Version Compiler Version
Visual Studio 2005 Visual C++ 8.0
Visual Studio 2008 Visual C++ 9.0
Visual Studio 2010 Visual C++ 10.0
Visual Studio 2012 Visual C++ 11.0
Visual Studio 2013 Visual C++ 12.0
Visual Studio 2015 Visual C++ 14.0
Visual Studio 2017 Visual C++ 14.1
Visual Studio 2019 Visual C++ 14.2
Visual Studio 2022 Visual C++ 14.3

So to explicitly answer your question, Visual Studio 2015 uses the compiler Visual C++ 14.0

Cory Kramer
  • 114,268
  • 16
  • 167
  • 218
  • I think, for some reason, they skipped a version in VS2015 and decided to go to version 14. That's very confusing. In addition to the VS version and the VC version, there is also an actual compiler version which is at 19.0 right now. – yzt Aug 07 '15 at 19:45
  • 1
    @yzt Yeah, it's confusing. They advertise and label it as VS2015 in most places I've seen, but for example, the compiler and associated files are in a folder called `Microsoft Visual Studio 14.0`. – R2-Dequeue Aug 07 '15 at 19:52
  • @R2-Dequeue Exactly. And if you run `cl.exe` which is the actual compiler, it will report version 19.00! – yzt Aug 07 '15 at 19:56
  • 8
    They missed a *huge* opportunity for syncing up the version with VS10/VC10. *sigh*... – yzt Aug 07 '15 at 20:05
  • 8
    There is no version 13.0; Visual Studio 2015 is version 14.0 internally. 13 was skipped. The year of release is used for the marketing names; the version numbers are used internally. When discussing the product generally, it's best to use the marketing name ("Visual Studio 2015" or "Visual C++ 2015") to avoid confusion. The version number of the compiler binaries is different (19 in this release) because the compiler predates the Visual C++ product; the Visual C++ compiler evolved out of an earlier C compiler (see https://en.wikipedia.org/wiki/Visual_C%2B%2B). – James McNellis Aug 07 '15 at 20:10
  • 4
    And to add to the confusion this is the Visual Studio version. The actual compiler version in VS 2015 is "19.00". Use ``cl -Bv``. It was "17.00" for VS 2012, "18.00" for VS 2013. – Chuck Walbourn Aug 07 '15 at 20:21
  • 3
    If you ask Visual Studio 2015 what the $(PlatformToolset) is, it will print "v140". Useful for setting build paths on projects that will be built with multiple compiler versions. (Such as a library.) – Meta Oct 09 '16 at 16:40
  • 1
    Also, if you are trying to build boost, boost-build calls it MSVC-14. I've never seen anybody else call it that, but at least that one is an acronym. It's hard to compare GCC to CLANG to Visual C++ 14.0 – Meta Oct 09 '16 at 16:47
13

You can get some useful information running this:

#include <stdio.h>

int main()
{
    printf("_MSC_VER : %d \n", _MSC_VER);
    printf("_MSC_FULL_VER : %d \n", _MSC_FULL_VER);
    printf("_MSC_BUILD : %d \n", _MSC_BUILD);

    #ifdef _MSVC_LANG
        printf("_MSVC_LANG : C++%d \n", (_MSVC_LANG/100)%2000);
    #endif

    return 0;
}

Common MSVC versions:

MSVC++ 9.0 _MSC_VER == 1500 (Visual Studio 2008)

MSVC++ 10.0 _MSC_VER == 1600 (Visual Studio 2010)

MSVC++ 11.0 _MSC_VER == 1700 (Visual Studio 2012)

MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013)

MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015)

MSVC++ 14.1 _MSC_VER == 1910 (Visual Studio 2017)

Macros interpretation:

_MSVC_LANG : Defined as an integer literal that specifies the C++ language standard targeted by the compiler

_MSC_VER : contains the major and minor version numbers as an integer (e.g. "1500" is version 15.00)

_MSC_FULL_VER : contains the major version, minor version, and build numbers as an integer (e.g. "150020706" is version 15.00.20706)

_MSC_BUILD : contains the revision number after the major version, minor version, and build numbers (e.g. "1" is revision 1, such as for 15.00.20706.01)

Dorin
  • 1,016
  • 1
  • 11
  • 15
9

The C/C++ compiler in Visual Studio is and always has been Microsoft C++ Compiler, built by Microsoft (not based on anything else.)

Right now, this is how the compiler names itself:

Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026

In VS2015, the compiler can target x86 and x64, as well as ARM. It supports almost all of C++11 and C99, and a large part of C++14, plus a little bit of the C++17 (or whenever) draft.

yzt
  • 8,873
  • 1
  • 35
  • 44
0

Basically, Visual Studio 2015 supports compiler Visual C++ 14.0. But for more detail, you can track what features of C++ 14.0 has already been implemented here.

Also, I like Dorin's answer, he pointed out a way to check compiler version with code.

123iamking
  • 2,387
  • 4
  • 36
  • 56