LINK: fatal error LNK 1104: cannot open file 'LIBCMT.lib'

后端 未结 7 1608
情深已故
情深已故 2021-01-08 00:31

Please help, I have spent all day trying to make my c++ app compile.

My project contains one source file: Foo.cpp. Here is its code:

#include 

        
7条回答
  •  暖寄归人
    2021-01-08 01:08

    This worked for me when I got …

    fatal error LNK1104: cannot open file 'LIBCMT.lib'
    

    Your project name == “Project Name” for this example.

    Go to the 'Solution Explorer' window for your Project.

    RIGHT Click on the Project "Project Name", not the Solution "Project Name".

    This will open a long menu.

    At the bottom is "Properties" Click on it.

    This will open the “Project Name” Property Pages window.

    IF the name of the window (upper left) says...

    “Solution 'Project Name' Property Pages

    Close this window, you right clicked on the Solution, not the Project, you need to right click on the project name.

    On the “Project Name” Property Pages

    Left hand panel expand Configuration Properties

    Then click on General

    Now the right panel should show the 'General' Configuration Properties' for your current Project.

    Look down the list to 'Platform Toolset'

    If the version of VS you are using is not the one listed you needed to change it.

    To change the version of VS just put you mouse pointer at the end of the current VS version name that is displayed and click.

    A box with a down arrow will show at the right hand side of that row, click on it.

    This will open a window with a list of VS versions.

    Pick the version of VS you are NOW using.

    That window should close, and your selection should have replaced the old project VS version that was used to build your project when I was first built.

    Then at bottom of “Project Name” Property Pages click Apply, then OK.

    Now try to build Project.

    I hope this helps, it works for me when working on projects that were built with earlier versions of VS.

    Good luck Mike.

提交回复
热议问题