Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete winget command for MSVC install on Windows 10 #13290

Open
Adrilihan opened this issue Feb 17, 2025 · 2 comments · May be fixed by #13295
Open

Incomplete winget command for MSVC install on Windows 10 #13290

Adrilihan opened this issue Feb 17, 2025 · 2 comments · May be fixed by #13295
Assignees
Labels
bug enhancement Improvement to an existing feature Language Service
Milestone

Comments

@Adrilihan
Copy link

Environment

  • OS and Version: Windows_NT x64 10.0.19045
  • VS Code Version: 1.97.2
  • C/C++ Extension Version: 1.23.6

Bug Summary and Steps to Reproduce

Bug Summary:

The winget command given on the walkthrough winget install Microsoft.VisualStudio.2022.BuildTools --force --override "--wait --passive --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK" installs an incomplete MSVC compiler that is unable to run the hello world example given on the walkthrough.

Steps to reproduce:

  1. Go to C++ walkthrough "Get Started with C++ Development"
  2. Execute the winget command given to install the Microsoft Visual C++ (MSVC) compiler
  3. Create the C++ file just like shown in the picture of step 2 of the walkthrough (the code is in the additional context section of this issue)
  4. See error about missing float.h from the #include <iostream>

Expected behavior:

Correct and complete installation of the MSCV compiler, which can execute the provided hello word example.

Temporary fix:

  1. Reinitialize the Visual Studio Installer
  2. Modify the installation of Visual Studio Build Tools 2022
  3. Deselect and select again the Desktop development with C++. There should be an additional 3GB of files to be installed
  4. Install

Basically, follow the instructions present in https://code.visualstudio.com/docs/cpp/config-msvc

Configuration and Logs

Not applicable

Other Extensions

No response

Additional context

Code in question of hello-world.cpp:

#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

Returns

C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\include\cfloat(10): fatal error C1083: Cannot open include file: 'float.h': No such file or directory

When compiled with MSVC compiler.

PS: On step 3 of the walkthrough "Launch from the Developer Command Prompt for VS" displays a blue button that restarts the VSC window, yet the instructions require that you close VSC and start it from development cmd or pwsh.

@bobbrow
Copy link
Member

bobbrow commented Feb 19, 2025

Thank you for reporting this. I could have sworn that was the command I tested on Windows 10 back when we added this feature in, but based on this page it would seem the correct package is now Microsoft.VisualStudio.Component.Windows10SDK.20348. I'll submit a fix and update the Windows 11 package while I'm at it.

@bobbrow
Copy link
Member

bobbrow commented Feb 20, 2025

PS: On step 3 of the walkthrough "Launch from the Developer Command Prompt for VS" displays a blue button that restarts the VSC window, yet the instructions require that you close VSC and start it from development cmd or pwsh.

Yeah, we should remove that. I'm actually working on a solution to make this scenario work without requiring you to launch from a Developer Command prompt in the future. Follow this issue to track when it's complete: #5271

@bobbrow bobbrow added bug Language Service enhancement Improvement to an existing feature labels Feb 20, 2025
@bobbrow bobbrow moved this to Pull Request in cpptools Feb 20, 2025
@bobbrow bobbrow added this to the On Deck milestone Feb 20, 2025
@bobbrow bobbrow self-assigned this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement Improvement to an existing feature Language Service
Projects
Status: Pull Request
Development

Successfully merging a pull request may close this issue.

2 participants