How to solve this problem in VisualStudio 2022 developer console?

Ruslan Semchenko 0 Reputation points
2025-03-05T08:34:42.9933333+00:00

********************************************************************** ** Visual Studio 2022 Developer Command Prompt v17.13.2 ** Copyright (c) 2022 Microsoft Corporation ********************************************************************** C:\Program Files\Microsoft Visual Studio\2022\Community>cd C:\Users\TannicArcher\Desktop\Program

C:\Users\TannicArcher\Desktop\Program>cl main.cpp

Оптимизирующий компилятор Microsoft (R) C/C++ версии 19.43.34808 для x86 (C) Корпорация Майкрософт (Microsoft Corporation). Все права защищены. main.cpp

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\include\cfloat(10): fatal error C1083: Не удается открыть файл включение: float.h: No such file or directory, C:\Users\TannicArcher\Desktop\Program>

When building in the visual studio itself as a project, everything is built well, that is, there is nothing like what is shown in the console
I try all repair and delete all visual studio in reg and etc not helped
image

Its my visual studio installer maybe i not download needed package?

Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,108 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 33,391 Reputation points Microsoft External Staff
    2025-03-05T13:10:01.45+00:00

    Hi @Ruslan Semchenko ,

    I believe that all the needed components have been installed, as you can successfully build the project in the Visual Studio.

    I think something is not set correctly or some settings are missing.

    Please try to use "set" command to check the environment variables(INCLUDE, LIB, LIBPATH). For example(set INCLUDE, set LIB):

    User's image

    If some paths are missing, try to use "set" command again to add them, then test the "cl" command again. For example(set INCLUDE=xxxx\xxxx;xxxx\xxxx\xxxx):

    Note: The following screenshot only shows an example. Do not set like that, use the specific paths. You can refer to the paths I shared in above screenshot.

    User's image

    Please also try to reset VS settings by running devenv /ResetSettings command in the Developer Command Prompt for VS 2022.

    Feel free to let us know the results.

    Best regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.