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

后端 未结 7 1597
情深已故
情深已故 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条回答
  •  -上瘾入骨i
    2021-01-08 01:03

    Running cl.exe directly requires that environment variables are set that point to libraries and tools. To get an idea of what variables need installed and what their values should be, I recommend installing Microsoft Visual C++ Compiler for Python 2.7. It adds command prompts to the start menu which automatically load the needed environment variables.

    After running the prompt, run set to see all of the environment variables.

    Examples:

    LIB=C:\Users\JBeach\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Lib;C:\Users\JBeach\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\WinSDK\Lib;
    LIBPATH=C:\Users\JBeach\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Lib;C:\Users\JBeach\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\WinSDK\Lib;
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_ARCHITEW6432=AMD64
    VCINSTALLDIR=C:\Users\JBeach\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\
    WindowsSdkDir=C:\Users\JBeach\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\WinSDK\
    

提交回复
热议问题