Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 310235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:48:53+00:00 2026-05-12T07:48:53+00:00

I must be missing something really obvious, but for some reason, the command-line version

  • 0

I must be missing something really obvious, but for some reason, the command-line version of the Microsoft C++ compiler (cl.exe) does not seem to support reporting just its version when run. We need this to write makefiles that check the compiler version a user of our tool has installed (they get makefiles with code they are to compile themselves locally, so we have no control over their compiler version).

In gcc, you just give the option -v or –version to get a nice version string printed.

In cl.exe, you get an error for -v.

I have read the MSDN docs and compiler online help, and I cannot find the switch to just print the compiler version. Annoyingly, you always get the version when the compiler starts… but you seem not to be able to start the compiler just to get the version out of it.

Finding compiler vendor / version using qmake seemed similar, but only deals with the simple case of gcc.

I am trying this with VC++ Express 2005, if that matters. I hoped it would not, as detecting the compiler version is best done in a compiler-version-independent way 🙂

Update, after replies:

  • Running cl.exe without any arguments
    prints its version and some help
    text.
  • This looks like the most
    portable way to get at the version,
    across vc versions.
  • You then have to
    parse a multi-line output, but that
    is not too difficult.
  • We did this in
    the end, and it works.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:48:53+00:00Added an answer on May 12, 2026 at 7:48 am

    Are you sure you can’t just run cl.exe without any input for it to report its version?

    I’ve just tested running cl.exe in the command prompt for VS 2008, 2005, and .NET 2003 and they all reported its version.

    For 2008:

    d:\Program Files\Microsoft Visual Studio 9.0\VC>cl

    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80×86

    For 2005, SP 1 (added Safe Standard C++ classes):

    C:\Program Files\Microsoft Visual Studio 8\VC>cl

    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80×86

    For 2005:

    C:\Program Files\Microsoft Visual Studio 8\VC>cl

    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80×86

    For .NET 2003:

    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.6030 for 80×86

    EDIT

    For 2010, it will be along the line of:

    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.XX.YYYYY.ZZ for 80×86

    or depending on targeted platform

    Microsoft (R) C/C++ Optimizing Compiler Version 16.XX.YYYYY.ZZ for x64

    For 2012:

    Microsoft (R) C/C++ Optimizing Compiler Version 17.XX.YYYYY.ZZ for $$$

    where $$$ is the targeted platform (e.g. x86, x64, ARM), and XX, YYYYY, and ZZ are minor version numbers.

    For 2013:

    Microsoft (R) C/C++ Optimizing Compiler Version 18.XX.YYYYY.ZZ for $$$

    where $$$ is the targeted platform (e.g. x86, x64, ARM), and XX, YYYYY, and ZZ are minor version numbers.

    For 2015:

    Microsoft (R) C/C++ Optimizing Compiler Version 19.XX.YYYYY for $$$

    where $$$ is the targeted platform (e.g. x86, x64, ARM), and XX and YYYYY are minor version numbers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 171k
  • Answers 171k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Is "Customers" actually a single Customer, not a list? In… May 12, 2026 at 2:22 pm
  • Editorial Team
    Editorial Team added an answer Check out std::swap vector<T> v1; // fill v1 vector<T> v2;… May 12, 2026 at 2:22 pm
  • Editorial Team
    Editorial Team added an answer 6b25ad0c-8223-49e7-ad94-a132127692c3 is a example of a UUID (Universally Unique Identifier)… May 12, 2026 at 2:22 pm

Related Questions

Lets say I have an object class Person { public string Name { get;
This should be really simple. If I have a String like this: ../Test?/sample*.txt then
I'm using an NSArrayController , NSMutableArray and NSTableView to show a list of my
I assume this is really easy, and I'm missing something obvious. I'm connecting to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.