How to fix error MSB4057 The target "ComputeLinkImportLibraryOutputsForClean" does not exist in the project

Veritum 5 Reputation points
2024-04-12T08:55:52.2633333+00:00

I am trying to make a game and everytime I build my solution this error pops up

I am using the following NuGet Packages

SDL

SDL_image.h

SOIL

Box2D

OpenAL.Soft

GLM

Boost

I am also using the following libraries

cpptoml

FastNoiseLite

ImGUI

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,617 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,532 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
942 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Gordon Elliott 5 Reputation points
    2024-04-23T23:15:15.01+00:00

    This is not an "answer" because the problem seems to be a bug in Visual Studio/Visual D in my case. BUT it is a WORKAROUND if your conditions match mine.

    In my case I get the similar message about:

    D:\Program Files (x86)\VisualD\msbuild\dcompile.targets(382,11): error MSB4057: The target "ComputeLinkImportLibraryOutputsForClean" does not exist in the project.

    AFTER successful build operation which in fact writes out the desired executable.

    My conditions are VS 17.9.6 on disk D:, project all C/C++ with one linked library referenced, either X64 or Win32. I have Visual D installed, which seems a factor in the error.

    Option 1:

    Check your "Output" tab to see if the build outputs the .exe file properly. If so then following workaround can get past the error message when debugging:

    Since output of the .exe is successful before the crazy error message, it asks "Would you like to continue and run the last successful build?" I hit yes and continue to successfully debug my program, with the latest updates compiled.

    If previously the build succeeded before the error, and you are only debugging again, you have to remember that the error is spurious and you won't see the build output the .exe file. But just continue as above and should work.

    (In my case I don't get this error message if the build actually failed before output of the .exe, I get the actual failure issue presented and this case would not apply. If building a release copy not debugged, just ignore the message if the output tab shows successful creation of exe or other targets before the error.)

    Option 2:

    I uninstalled the entire Visual D application using Windows 10 "Aps & features" on control panel. Seems to resolve the problem (of course no longer have D language available). I see reference to this problem in the Visual D GitHub source, and suspect that updating to latest version of Visual D will also fix the problem (but have not tried yet).

    1 person found this answer helpful.
    0 comments No comments

  2. Anna Xiu-MSFT 25,796 Reputation points Microsoft Vendor
    2024-04-15T03:07:57.7066667+00:00

    Hi @Veritum

    Welcome to Microsoft Q&A! 

    The error often occurs when the target name is misspelled or not included in the project file.

    Please check the spelling of the target and ensure that it's present in the project file or its imports.

    And check the logic of conditions to make sure that the target is included under the relevant conditions.

    You can see: MSB4057

    Sincerely,

    Anna


    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.