Wireshark-dev: Re: [Wireshark-dev] Visual Studio 2022

From: Graham Bloice <graham.bloice@xxxxxxxxxxxxx>
Date: Sat, 15 Jan 2022 21:02:34 +0000


On Sat, 15 Jan 2022 at 18:55, Gerald Combs <gerald@xxxxxxxxxxxxx> wrote:
On 1/15/22 4:37 AM, Guy Harris wrote:
> On Jan 15, 2022, at 3:09 AM, Gisle Vanem <gisle.vanem@xxxxxxxxx> wrote:
>
>> Anders Broman wrote:
>>
>>> Hi,
>>> Yes sounds like a good idea. Have been contemplating testing it too.
>>
>> I just installed the "Build Tools for Visual Studio 2022"
>>   https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
>
> "These Build Tools allow you to build Visual Studio projects from a command-line interface."
>
> Does that mean
>
>       this is Visual Studio without the "Visual", i.e. it's all the command-line tools, but without the IDE
>
> or
>
>       if you just install Visual Studio, you don't get the command-line tools - you also have to install this?
>
> The former sounds like "Command Line Tools for Xcode {version}" on macOS or "don't install any IDE" on the free-software UN*Xes (I don't know whether Oracle Studio offers that).
>
> The latter seems less likely, as I think most IDEs either run the compiler/linker/other tools directly or run some builder program (make, msbuild, etc.) that runs the compiler/linker/other tools, but I guess if the core of the compiler/linker are in libraries that the command-line tools link with and that an IDE program could link with as well (say hello, LLVM), it would be possible.

The Developer's Guide recommends installing the Native Desktop workload. Reading through the list of components at

https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022#desktop-development-with-c

it looks like Microsoft.VisualStudio.Component.VC.CoreBuildTools corresponds to "Build Tools for Visual Studio 2022" and Microsoft.VisualStudio.Component.VC.Tools.x86.x64 includes the compiler.


I set up my environment by running

----
choco install -y visualstudio2022community visualstudio2022-workload-nativedesktop
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat
----


You can specify the workloads as arguments to the 

 
The first line of `cl.exe /?` returns

----
Microsoft (R) C/C++ Optimizing Compiler Version 19.30.30706 for x64
----


The MSVC version numbering is somewhat exotic, the table given by Wikipedia (https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering) seems accurate, the cl.exe version is the initial value under the _MSC_VER column.


--
Graham Bloice