Skip to content

Unrecognized Flag '-Yu' in 'p2' #1031

Closed

Description

@Tembocs

Trying to build from Windows 10 x64 using Visual Studio 2019 and got his error message.
unrecognized flag '-Yu' in 'p2'. This is from the current master branch. How do I resolve this? Is it something to do with UTF-8? What is the workaround then? Can't be applied to the whole repo? I have tried to search related issues without success with proposed solutions.

Activity

  1. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on May 27, 2019
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on May 27, 2019
  3. zadjii-msft commented on May 28, 2019

    @zadjii-msft
    Member

    Could you give some more context on that error text? I've never seen it before.

  4. added
    Area-BuildIssues pertaining to the build system, CI, infrastructure, meta
    Needs-Author-FeedbackThe original author of the issue/PR needs to come back and respond to something
    Product-MetaThe product is the management of the products.
    on May 28, 2019
  5. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on May 28, 2019
  6. bjohnson-fsi commented on May 30, 2019

    @bjohnson-fsi

    Getting the same error when trying to build for x64 using Visual Studio 2019.

    Full Error List:

    image

  7. mmdanggg2 commented on Jun 1, 2019

    @mmdanggg2

    I'm getting this too, trying to build x64 Release, Debug builds fine...
    image

  8. kopwei commented on Jun 1, 2019

    @kopwei

    The same. Debug x64 build passed but Release x64 failed with same issue.

    1>------ Build started: Project: TerminalConnection, Configuration: Release x64 ------
    1>LINK : fatal error C1007: unrecognized flag '-Yu' in 'p2'
    1>LINK : fatal error LNK1257: code generation failed
    1>Done building project "TerminalConnection.vcxproj" -- FAILED.
    2>------ Build started: Project: TerminalControl, Configuration: Release x64 ------
    2>LINK : fatal error C1007: unrecognized flag '-Yu' in 'p2'
    2>LINK : fatal error LNK1257: code generation failed
    2>Done building project "TerminalControl.vcxproj" -- FAILED.

  9. baget commented on Jun 2, 2019

    @baget

    Could you give some more context on that error text? I've never seen it before.

    I also saw this.

    • Clone the repro,
    • Update the submodules
    • Opened with VS2019
    • upgrade the solution
    • build the solution.

    This is the Error that I get

    27>------ Build started: Project: Host.unittest, Configuration: Release x64 ------
    25>readData.cpp
    27>precomp.cpp
    25>readDataDirect.cpp
    25>readDataRaw.cpp
    25>registry.cpp
    15>Nihilist.vcxproj -> D:\MyProjects\GitHub\terminal\\bin\x64\Release\Nihilist.exe
    24>LINK : fatal error C1007: unrecognized flag '-Yu' in 'p2'
    24>LINK : fatal error LNK1257: code generation failed
    
  10. braindef commented on Jun 4, 2019

    @braindef

    i have the same Error...

  11. HimiSaber commented on Jun 4, 2019

    @HimiSaber

    Right click solution -->retarget solution,change to latest

  12. boldcronie commented on Jun 7, 2019

    @boldcronie

    I had the same error. VS2019/tools v142, and every build failed with at least two modules returning the "Unrecognized flag -Yu in p2" error. Re-targeted after clone, and individually re-targeted the UWP projects that didn't move from 141 to 142 during the initial re-target. Still got the errors during every build.

    Tried HimiSaber's solution -- after another failed build, right-clicked the OpenConsole.sln and clicked Re-target solution. That finished, so I built again. No errors! Launching the WindowsTerminal.exe still didn't work (would appear, then disappear after a few seconds), but I deployed anyway. Only took a few seconds, as the solution had been properly built. Checked Start Menu, and Windows Terminal (Dev Build) was there and working!

    Thank you HimiSaber! I almost didn't try it, as I'd already re-targeted several times.

  13. Tembocs commented on Jun 7, 2019

    @Tembocs
    Author

    HimiSaber and boldcronie, thank you so much this works. I have successful built WindowsTerminal and deploy. Its working and fast.

  14. ghost added
    Needs-AttentionThe core contributors need to come back around and look at this ASAP.
    on Jun 7, 2019
  15. ghost removed
    Needs-Author-FeedbackThe original author of the issue/PR needs to come back and respond to something
    on Jun 7, 2019
  16. DHowett-MSFT commented on Jun 10, 2019

    @DHowett-MSFT
    Contributor

    This will be fixed by #1012.

  17. oliver-ni commented on Jun 21, 2019

    @oliver-ni

    @NycuRO did you try HimiSaber's solution? Worked for me

  18. devinvisible commented on Dec 7, 2020

    @devinvisible

    I had a similar issue in a completely unrelated project. Going into my project properties and setting Linker -> General -> Show Progress to /VERBOSE gave me a clue -- it showed a library of mine that it was searching for. A stack overflow comment suggested this was caused by this library being built with a different version of visual studio. I rebuilt both using the same version of visual studio (being mindful to build the appropriate architecture & release) and this error went away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-BuildIssues pertaining to the build system, CI, infrastructure, metaHelp WantedWe encourage anyone to jump in on these.Issue-QuestionFor questions or discussionProduct-MetaThe product is the management of the products.Resolution-AnsweredRelated to questions that have been answered

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions