缺少kernel32.lib和rc.exe

本文探讨了在VC++环境下遇到kernel32.lib和rc.exe缺失的两个常见原因及解决方案。首先,检查VC++目录的库路径是否包含必要的lib文件,如未包含,则需添加program86/MicrosoftSDKs/window/7.1A/lib路径。其次,确认环境变量中是否包含sdk/7.0A或其他相关变量,同时调整属性设置,确保平台工具集正确指向VS2013与Windows xp120xp。

缺少kernel32.lib和rc.exe
第一个原因:vc++目录-库目录 缺少该lib文件存在目录
解决:添加该文件路径program86/Microsoft SDKs/window/7.1A/lib

第二个原因:
1.缺少环境变量sdk/7.0A 或其他变量
2.属性-常规-平台工具集-vs2013-Windows xp120 xp
3vs未注册?

>------ 生成 已启动: 项目: CMakeLists,配置: Debug ------ [1/1] Linking CXX executable MiniDraw.exe FAILED: MiniDraw.exe C:\WINDOWS\system32\cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\MiniDraw.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1440~1.338\bin\Hostx64\x64\link.exe /nologo CMakeFiles\MiniDraw.dir\MiniDraw_autogen\mocs_compilation.cpp.obj /out:MiniDraw.exe /implib:MiniDraw.lib /pdb:MiniDraw.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:windows D:\qt\6.9.3\msvc2022_64\lib\Qt6Widgetsd.lib D:\qt\6.9.3\msvc2022_64\lib\Qt6Guid.lib D:\qt\6.9.3\msvc2022_64\lib\Qt6Cored.lib mpr.lib userenv.lib D:\qt\6.9.3\msvc2022_64\lib\Qt6EntryPointd.lib shell32.lib d3d11.lib dxgi.lib dxguid.lib d3d12.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1440~1.338\bin\Hostx64\x64\link.exe /nologo CMakeFiles\MiniDraw.dir\MiniDraw_autogen\mocs_compilation.cpp.obj /out:MiniDraw.exe /implib:MiniDraw.lib /pdb:MiniDraw.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:windows D:\qt\6.9.3\msvc2022_64\lib\Qt6Widgetsd.lib D:\qt\6.9.3\msvc2022_64\lib\Qt6Guid.lib D:\qt\6.9.3\msvc2022_64\lib\Qt6Cored.lib mpr.lib userenv.lib D:\qt\6.9.3\msvc2022_64\lib\Qt6EntryPointd.lib shell32.lib d3d11.lib dxgi.lib dxguid.lib d3d12.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\MiniDraw.dir/intermediate.manifest CMakeFiles\MiniDraw.dir/manifest.res" failed (exit code 1120) with the following output: D:\ProgramTrain\MiniDraw\out\build\debug\Qt6EntryPointd.lib(qtentrypoint_win.cpp.obj) : error LNK2019: 无法解析的外部符号 main,函数 "int __cdecl qtEntryPoint(void)" (?qtEntryPoint@@YAHXZ) 中引用了该符号 D:\ProgramTrain\MiniDraw\out\build\debug\MiniDraw.exe : fatal error LNK1120: 1 个无法解析的外部命令 ninja: build stopped: subcommand failed.
10-26
CMake Error at E:/vs2022/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "E:/vs2022/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: 'E:/visualstudio‘sproject/workflow-master/workflow-master/out/build/x64-Debug/CMakeFiles/CMakeScratch/TryCompile-ohfyd7' Run Build Command(s): E:\VS2022\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe -v cmTC_19bd4 [1/2] E:\vs2022\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\cl.exe /nologo /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_19bd4.dir\testCCompiler.c.obj /FdCMakeFiles\cmTC_19bd4.dir\ /FS -c E:\visualstudio‘sproject\workflow-master\workflow-master\out\build\x64-Debug\CMakeFiles\CMakeScratch\TryCompile-ohfyd7\testCCompiler.c [2/2] C:\WINDOWS\system32\cmd.exe /C "cd . && E:\vs2022\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E vs_link_exe --msvc-ver=1944 --intdir=CMakeFiles\cmTC_19bd4.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- E:\vs2022\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_19bd4.dir\testCCompiler.c.obj /out:cmTC_19bd4.exe /implib:cmTC_19bd4.lib /pdb:cmTC_19bd4.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." FAILED: cmTC_19bd4.exe C:\WINDOWS\system32\cmd.exe /C "cd . && E:\vs2022\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E vs_link_exe --msvc-ver=1944 --intdir=CMakeFiles\cmTC_19bd4.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- E:\vs2022\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_19bd4.dir\testCCompiler.c.obj /out:cmTC_19bd4.exe /implib:cmTC_19bd4.lib /pdb:cmTC_19bd4.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." RC Pass 1: command "rc /fo CMakeFiles\cmTC_19bd4.dir/manifest.res CMakeFiles\cmTC_19bd4.dir/manifest.rc" failed (exit code 0) with the following output: no such file or directory ninja: build stopped: subcommand failed. CMake will not be able to correctly generate this project.
最新发布
11-14
C:\Qt\Tools\CMake_64\share\cmake-3.30\Modules\CMakeTestCXXCompiler.cmake:73: error: The C++ compiler "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/HostX64/x64/cl.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: 'C:/Qt/Examples/Qt-6.6.3/demos/calqlatr/build/Desktop_Qt_6_6_3_MSVC2019_64bit-Debug/CMakeFiles/CMakeScratch/TryCompile-p6qlk1' Run Build Command(s): C:/Qt/Tools/Ninja/ninja.exe -v cmTC_4f979 [1/2] "C:\PROGRA~1\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64\cl.exe" /nologo /TP -DQT_QML_DEBUG /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd /showIncludes /FoCMakeFiles\cmTC_4f979.dir\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_4f979.dir\ /FS -c C:\Qt\Examples\Qt-6.6.3\demos\calqlatr\build\Desktop_Qt_6_6_3_MSVC2019_64bit-Debug\CMakeFiles\CMakeScratch\TryCompile-p6qlk1\testCXXCompiler.cxx [2/2] C:\Windows\system32\cmd.exe /C "cd . && C:\Qt\Tools\CMake_64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_4f979.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- "C:\PROGRA~1\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\cmTC_4f979.dir\testCXXCompiler.cxx.obj /out:cmTC_4f979.exe /implib:cmTC_4f979.lib /pdb:cmTC_4f979.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." FAILED: cmTC_4f979.exe C:\Windows\system32\cmd.exe /C "cd . && C:\Qt\Tools\CMake_64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_4f979.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- "C:\PROGRA~1\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\cmTC_4f979.dir\testCXXCompiler.cxx.obj /out:cmTC_4f979.exe /implib:cmTC_4f979.lib /pdb:cmTC_4f979.pdb /version:0.0 /machine:x64 /d
03-26
FAILED: [code=2] sleef/src/common/CMakeFiles/addSuffix.dir/addSuffix.c.obj C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\cl.exe /nologo -DEXPORT_AOTI_FUNCTIONS -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DNOMINMAX -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DUSE_EXTERNAL_MZCRC -DUSE_MIMALLOC -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_UCRT_LEGACY_INFINITY -IE:\PyTorch_Build\pytorch\build\aten\src -IE:\PyTorch_Build\pytorch\aten\src -IE:\PyTorch_Build\pytorch\build -IE:\PyTorch_Build\pytorch -IE:\PyTorch_Build\pytorch\nlohmann -IE:\PyTorch_Build\pytorch\moodycamel -IE:\PyTorch_Build\pytorch\third_party\mimalloc\include -IE:\PyTorch_Build\pytorch\third_party\sleef\src\common -IE:\PyTorch_Build\pytorch\third_party\sleef\src\arch -external:IE:\PyTorch_Build\pytorch\cmake\..\third_party\googletest\googlemock\include -external:IE:\PyTorch_Build\pytorch\cmake\..\third_party\googletest\googletest\include -external:IE:\PyTorch_Build\pytorch\third_party\protobuf\src -external:IE:\PyTorch_Build\pytorch\third_party\XNNPACK\include -external:IE:\PyTorch_Build\pytorch\torch\include -external:IE:\PyTorch_Build\pytorch\cmake\..\third_party\eigen -external:IE:\PyTorch_Build\pytorch\third_party\ideep\include -external:IE:\PyTorch_Build\pytorch\INTERFACE -external:IE:\PyTorch_Build\pytorch\third_party\nlohmann\include -external:IE:\PyTorch_Build\pytorch\third_party\concurrentqueue -external:W0 /DWIN32 /D_WINDOWS /bigobj -DNDEBUG /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /O2 /Ob2 /DNDEBUG /bigobj -DNDEBUG -MD /showIncludes /Fosleef\src\common\CMakeFiles\addSuffix.dir\addSuffix.c.obj /Fdsleef\src\common\CMakeFiles\addSuffix.dir\ /FS -c E:\PyTorch_Build\pytorch\third_party\sleef\src\common\addSuffix.c E:\PyTorch_Build\pytorch\third_party\sleef\src\common\addSuffix.c(6): fatal error C1083: 无法打开包括文件: “stdio.h”: No such file or directory [5105/7459] Linking C shared library bin\torch_global_deps.dll FAILED: [code=4294967295] bin/torch_global_deps.dll lib/torch_global_deps.lib C:\WINDOWS\system32\cmd.exe /C "cd . && E:\Python310\Lib\site-packages\cmake\data\bin\cmake.exe -E vs_link_dll --msvc-ver=1944 --intdir=caffe2\CMakeFiles\torch_global_deps.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\link.exe /nologo caffe2\CMakeFiles\torch_global_deps.dir\__\torch\csrc\empty.c.obj /out:bin\torch_global_deps.dll /implib:lib\torch_global_deps.lib /pdb:bin\torch_global_deps.pdb /dll /version:0.0 /machine:x64 /ignore:4049 /ignore:4217 /ignore:4099 /INCREMENTAL:NO "E:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cudart.lib" kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." LINK: command "C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\link.exe /nologo caffe2\CMakeFiles\torch_global_deps.dir\__\torch\csrc\empty.c.obj /out:bin\torch_global_deps.dll /implib:lib\torch_global_deps.lib /pdb:bin\torch_global_deps.pdb /dll /version:0.0 /machine:x64 /ignore:4049 /ignore:4217 /ignore:4099 /INCREMENTAL:NO E:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cudart.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=2" failed (exit code 1181) with the following output: LINK : fatal error LNK1181: 无法打开输入文件“kernel32.lib” ninja: build stopped: cannot make progress due to previous errors. (pytorch_env) PS E:\PyTorch_Build\pytorch> (pytorch_env) PS E:\PyTorch_Build\pytorch> # 如果上述命令失败,尝试重新生成并编译 (pytorch_env) PS E:\PyTorch_Build\pytorch> python setup.py clean Building wheel torch-2.9.0a0+git2d31c3d E:\PyTorch_Build\pytorch\pytorch_env\lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated !! ******************************************************************************** Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0). By 2026-Feb-18, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! corresp(dist, value, root_dir) running clean (pytorch_env) PS E:\PyTorch_Build\pytorch> python setup.py develop --cmakem Building wheel torch-2.9.0a0+git2d31c3d option --cmakem not recognized (pytorch_env) PS E:\PyTorch_Build\pytorch> # 编译完成后验证 (pytorch_env) PS E:\PyTorch_Build\pytorch> python -c "import torch; print(torch.__version__); print(torch.cuda.is_available())" Traceback (most recent call last): File "<string>", line 1, in <module> File "E:\PyTorch_Build\pytorch\torch\__init__.py", line 69, in <module> from torch.torch_version import __version__ as __version__ File "E:\PyTorch_Build\pytorch\torch\torch_version.py", line 5, in <module> from torch.version import __version__ as internal_version ModuleNotFoundError: No module named 'torch.version'
09-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值