none
link.exe error after retargetting to Visual Studio 2019 RRS feed

  • Question

  • I've started to retarget our projects to Visual Studio 2019. I had no issues with projects in a couple of our smaller Solutions. The current project I'm building is generating this error.

    1>Generating code
    1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(725,5): error MSB6006: "link.exe" exited with code -1073740940.

    This is with the Release configuration. Building the Debug configuration does not have this error.

    I've been searching the forums but haven't found anything that has helped. Does that error code (0xC0000374) correspond to the error codes in winnt.h (STATUS_HEAP_CORRUPTION) ?

    Visual Studio is up to date (16.2.0).

    Can anyone suggest how I can get passed this link error ?



    • Edited by Tony461 Tuesday, August 6, 2019 12:18 AM
    Tuesday, August 6, 2019 12:16 AM

All replies

  • Hi Tony461,

    Welcome to the MSDN forum.

    According to your description, you can try to disable the Whole Program Optimization. Please follow these steps to have a try:

    •  Right-click on your project->Properties->Configuration Properties->Advanced->Whole Program Optimization->choose "No Whole Program Optimization"

    This will turn off link time code generation to see if it helps.

    If there is any concern, please feel free to let us know.

    Best Regards,

    Perry



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Tuesday, August 6, 2019 7:03 AM
  • Hi Tony461,

    Did you follow my steps to have a try? Did you issue solve? If your issue still exist, please feel free to let us know so that we will discuss further and give you a better solution.

    We are looking forward to hearing from you.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Wednesday, August 7, 2019 9:26 AM
  • Hi Perry,

    Thanks for the response. Our projects already have that setting.

    I was trying other things yesterday but still couldn't find a solution to this error. One of the things I tried was I made the Release configuration Linker settings the same as the Debug configuration Linker settings (remembering Debug works) but the Release still gets the error.

    Note, prior to moving to VS 2019 our solutions were successfully building with VS 2013.

    Regards,

    Anthony.



    • Edited by Tony461 Thursday, August 8, 2019 12:33 AM
    Wednesday, August 7, 2019 11:11 PM
  • Hi Tony461,

    Thanks for your feedback.

    In addition to the step I mentioned above, you should set "Generate Mainifest" as No in the option Linker->Manifest File

    >>More information you can refer to this.

    BTW, what the type of your project?

    If it does not work, please share the demo or the key code with us to help you further.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, August 8, 2019 10:49 AM
  • Hi Perry,

    That setting doesn't help unfortunately.

    Our projects are C++ projects. This particular one is a DLL.

    What do you mean by demo or key code ?

    Regards,

    Anthony.

    Friday, August 9, 2019 4:42 AM
  • Hi Tony461,

    According to your description, we suggest you can try to change the Platform Toolset to Visual Studio 2013 in VS2019 like the picture below, since you have already installed VS2013 in your agent.

    So you try to build your project in this way to check whether the issue exists.

    Any feedback will be expected.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, August 9, 2019 9:08 AM
  • Hi Perry,

    prior to retargeting the projects to VS 2019, I was successfully building our projects in VS 2019 with VS 2013 as the target.

    Anthony.

    Monday, August 12, 2019 10:49 PM
  • Hi Tony461,

    We are glad to hear that you solved your issue.

    If you have any other problems about this, please feel free to let us know.

    If my answer is helpful for you to solve this issue, please remember to mark as answer so that it will it will help other community members search similar issues.

    Thanks for your understanding.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, August 13, 2019 1:59 AM
  • Hi Perry,

    I think you misunderstood my answer. The issue has not been solved.

    Yes, we can target VS 2013 but that's not what we want to do. We are trying to move away from VS 2013 and target VS 2019 so that we're using the latest toolset.

    I've raised this on the Developer Community and a Microsoft representative has filed a bug report and its currently under investigation. 

    Regards,

    Anthony.

    Tuesday, August 13, 2019 2:10 AM
  • Hi Tony461,

    Perhaps you can upgrade the old version of your project from this:

    https://docs.microsoft.com/en-us/cpp/porting/upgrading-projects-from-earlier-versions-of-visual-cpp?view=vs-2019

    >>>You can try clean and rebuild your project multiple times.

    Since you have sent the issue to the VS product team, if the solution does not work, you can wait for feedback from product team.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, August 13, 2019 9:51 AM