My first C++ HelloWorld console app failed at compiling with error MSB6006 "CL.exe" exited with code 1

Kelly Zhao 65 Reputation points Microsoft Employee
2023-09-26T23:08:25.3+00:00

Hi, I am creating a C++ "HelloWorld" console app in Visual Studio following this doc https://learn.microsoft.com/en-us/cpp/build/vscpp-step-1-create?view=msvc-170.

And I am getting a compiler error: MSB6006 "CL.exe" exited with code 1 at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets

    <CL Condition="'%(ClCompile.PrecompiledHeader)' != 'Create' and '%(ClCompile.CompileAs)'!='CppModule' and '%(ClCompile.CompilerIteration)' == '' and @(ClCompile) != '' and '$(MultiProcCL)' != 'true'"

I have already installed components under "desktop development with C++". 
Could you please help me with the issue? Thank you!

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,051 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,690 questions
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,034 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 45,236 Reputation points
    2023-09-27T07:01:24.0933333+00:00

    Towards the bottom the build error text file contained the line -

    BullseyeCoverage error: License expired 2023-06-11. Today is 2023-09-26

    If you installed the Enterprise version of VS2022 then I'm guessing that the trial period has expired and you have not obtained a valid license for its continued use.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Zhengye Xu-MSFT 95 Reputation points Microsoft Vendor
    2023-09-27T03:24:51.51+00:00

    Hello Kelly Zhao,

    Welcome to Microsoft Q&A forum.

    Please set your MSBuild Project Build Output verbosity to Detailed. Then you can get the details of the build and see the error. (Main menu>Tools>Options>Projects and Solutions>Build And Run)

    User's image

    You can then follow these suggestions:

    1. Recreate the C++ project to check if the problem is a project-specific issue.
    2. Please check whether you have any warnings on your NuGet packages. If so, please reinstall them.
    3. If you have licenses.licx files, you should exclude them from your project.
    4. Use the Visual Studio installer to repair Visual Studio.

    If you get a more detailed error in the build information, it will be more conducive to our analysis of the problem.


    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.