Finding version of Microsoft C++ compiler from command-line (for makefiles)

后端 未结 6 1174
孤城傲影
孤城傲影 2020-12-04 21:00

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

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-04 21:44

    Try:

    cl /v
    

    Actually, any time I give cl an argument, it prints out the version number on the first line.

    You could just feed it a garbage argument and then parse the first line of the output, which contains the verison number.

提交回复
热议问题