how to build on c++ lasted, when using msbuild

lyun518 1 Reputation point
2022-02-16T01:43:47.21+00:00

I used msbuild parmeter in jenkins:

> msbuild "myproject.sln" /p:Configuration="Release";Platform="Win32" /t:Rebuild -maxcpucount:4

and i want add option, like: /std:c++17 (compile lang version ?)

how can i do??

sorry my terrible english... :<

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,664 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 30,346 Reputation points Microsoft Vendor
    2022-02-16T07:15:51.973+00:00

    Hi @lyun518 ,

    Welcome to Microsoft Q&A forum.

    If you select the c++17 version in Properties > Configuration Properties > General > C++ Language Standard, and then right-click your project and click Unload Project, and right-click it again click Edit Project File, you can then find that in .vcxproj file, there is a corresponding property called <LanguageStandard>stdcpp17</LanguageStandard>.

    You can try to add this property into msbuild command like msbuild "myproject.sln" /p:LanguageStandard="stdcpp17"

    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.
    0 comments No comments

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.