vs2019 报错 error MSB6006: “CL.exe“ exited with code -1073740940.

本文介绍了解决VS2019中使用C++11/14/17新特性时出现错误的方法。通过调整项目属性中的C/C++浏览信息选项卡内的EnableBrowseInformation设置,可以有效解决此类问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

vs2019使用c++11/14/17一些新特性时有时候会报错。

解决方案:项目属性 -> C/C++ -> browse information 选项卡 把 Enable Browse Information 选项由(Yes/FR)调整为(No)。

Collecting pin==2.7.0 (from -r requirements.txt (line 55)) Using cached pin-2.7.0.tar.gz (61.8 MB) Installing build dependencies ... error error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [170 lines of output] Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu118 Collecting cmeel-boost~=1.83.0 Using cached cmeel_boost-1.83.0.tar.gz (4.0 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error Preparing metadata (pyproject.toml) did not run successfully. exit code: 1 [144 lines of output] -- Building for: Visual Studio 17 2022 -- The C compiler identification is MSVC 19.44.35211.0 -- The CXX compiler identification is MSVC 19.44.35211.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Python3: C:\Users\__CellMan\.conda\envs\foundationpose\python.exe (found version "3.9.23") found components: Interpreter Development.Module -- CONFIGURE_COMMAND: ./bootstrap.sh;--prefix=C:/Users/__CELL~1/AppData/Local/Temp/cmeel-1somp3uw/whl/cmeel.prefix -- BUILD_COMMAND: ./b2;hardcode-dll-paths=true;dll-path='$ORIGIN';link=shared;python=3.9 -- Configuring done (16.4s) -- Generating done (0.0s) CMake Warning: Manually-specified variables were not used by the project: BUILD_TESTING Boost_NO_WARN_NEW_VERSIONS CMAKE_APPLE_SILICON_PROCESSOR CMAKE_INSTALL_LIBDIR CMEEL_JOBS PYTHON_SITELIB -- Build files have been written to: C:/Users/__CELL~1/AppData/Local/Temp/cmeel-1somp3uw/bld 閫傜敤浜\x8e .NET Framework MSBuild 鐗堟湰 17.14.14+a129329f1 C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(548,5): w arning MSB8029: 涓\xad闂寸洰褰曟垨杈撳嚭鐩\xae褰曟棤娉曢┗鐣欏湪涓存椂鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚鍑 虹幇闂\xae棰樸\x80\x82 [C:\Users\__CELL~1\AppData\Local\Temp\cmeel-1somp3uw\bld\ZERO_CHECK.vcxproj] 1>Checking Build System C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(548,5): w arning MSB8029: 涓\xad闂寸洰褰曟垨杈撳嚭鐩\xae褰曟棤娉曢┗鐣欏湪涓存椂鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚鍑 虹幇闂\xae棰樸\x80\x82 [C:\Users\__CELL~1\AppData\Local\Temp\cmeel-1somp3uw\bld\Boost.vcxproj] Creating directories for 'Boost' Building Custom Rule C:/Users/__CellMan/AppData/Local/Temp/pip-install-5pxl6tt_/cmeel-boost_4fb6f8d6aeca48aab18582433951fa01/CMakeLists.txt Performing download step (download, verify and extract) for 'Boost' -- Downloading... dst='C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2' timeout='none' inactivity timeout='none' -- Using src='https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2' -- [download 100% complete] -- [download 22% complete] -- [download 58% complete] -- [download 100% complete] -- verifying file... file='C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2' -- SHA256 hash of C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2 does not match expected value expected: '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' actual: 'e0f020de72913559199b5698b1f50a733dcfd7e1b0532de4a2357c3baca95e0f' -- Hash mismatch, removing... -- Using src='https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2' -- [download 100% complete] -- [download 58% complete] -- [download 100% complete] -- verifying file... file='C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2' -- SHA256 hash of C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2 does not match expected value expected: '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' actual: 'e0f020de72913559199b5698b1f50a733dcfd7e1b0532de4a2357c3baca95e0f' -- Hash mismatch, removing... -- Using src='https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2' -- [download 100% complete] -- [download 9% complete] -- [download 22% complete] -- [download 58% complete] -- [download 70% complete] -- [download 100% complete] -- verifying file... file='C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2' -- SHA256 hash of C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2 does not match expected value expected: '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' actual: 'e0f020de72913559199b5698b1f50a733dcfd7e1b0532de4a2357c3baca95e0f' -- Hash mismatch, removing... -- Using src='https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2' -- [download 100% complete] -- [download 22% complete] -- [download 58% complete] -- [download 100% complete] -- verifying file... file='C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2' -- SHA256 hash of C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2 does not match expected value expected: '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' actual: 'e0f020de72913559199b5698b1f50a733dcfd7e1b0532de4a2357c3baca95e0f' -- Hash mismatch, removing... -- Using src='https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2' -- [download 100% complete] -- [download 22% complete] -- [download 34% complete] -- [download 100% complete] -- verifying file... file='C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2' -- SHA256 hash of C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2 does not match expected value expected: '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' actual: 'e0f020de72913559199b5698b1f50a733dcfd7e1b0532de4a2357c3baca95e0f' -- Hash mismatch, removing... -- Using src='https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2' -- [download 100% complete] -- [download 22% complete] -- [download 34% complete] -- [download 58% complete] -- [download 100% complete] -- verifying file... file='C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2' -- SHA256 hash of C:/Users/__CellMan/AppData/Local/Temp/cmeel-1somp3uw/bld/Boost-prefix/src/boost_1_83_0.tar.bz2 does not match expected value expected: '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' actual: 'e0f020de72913559199b5698b1f50a733dcfd7e1b0532de4a2357c3baca95e0f' -- Hash mismatch, removing... CMake Error at Boost-stamp/download-Boost.cmake:163 (message): Each download failed! C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: 鈥淐:\Users\__CELL~1\AppData\Local\Temp\cmeel-1somp3uw\bld\CMakeFiles\755458b903e4cca2d215a37840379c36\Boost-mk dir.rule;C:\Users\__CELL~1\AppData\Local\Temp\cmeel-1somp3uw\bld\CMakeFiles\755458b903e4cca2d215a37840379c36\Boost-download.ru le;C:\Users\__CELL~1\AppData\Local\Temp\cmeel-1somp3uw\bld\CMakeFiles\755458b903e4cca2d215a37840379c36\Boost-update.rule;C:\Us ers\__CELL~1\AppData\Local\Temp\cmeel-1somp3uw\bld\CMakeFiles\755458b903e4cca2d215a37840379c36\Boost-patch.rule;C:\Users\__CEL L~1\AppData\Local\Temp\cmeel-1somp3uw\bld\CMakeFiles\755458b903e4cca2d215a37840379c36\Boost-configure.rule;C:\Users\__CELL~1\A ppData\Local\Temp\cmeel-1somp3uw\bld\CMakeFiles\755458b903e4cca2d215a37840379c36\Boost-build.rule;C:\Users\__CELL~1\AppData\Lo cal\Temp\cmeel-1somp3uw\bld\CMakeFiles\755458b903e4cca2d215a37840379c36\Boost-install.rule;C:\Users\__CELL~1\AppData\Local\Tem p\cmeel-1somp3uw\bld\CMakeFiles\afcbe1798a3d8227aea59f65cb94f1da\Boost-complete.rule;C:\Users\__CELL~1\AppData\Local\Temp\cmee l-1somp3uw\bld\CMakeFiles\e26596573a2d2b2916d37c037e150495\Boost.rule;C:\Users\__CellMan\AppData\Local\Temp\pip-install-5pxl6t t_\cmeel-boost_4fb6f8d6aeca48aab18582433951fa01\CMakeLists.txt鈥濈殑鑷\xaa瀹氫箟鐢熸垚宸查\x80\x80鍑猴紝浠g爜涓\xba 1銆\x82 [C:\Users\__CELL~1\AppData\Local\Temp\cmeel-1somp3uw\bld\Boost.vcxproj] Traceback (most recent call last): File "C:\Users\__CellMan\.conda\envs\foundationpose\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module> main() File "C:\Users\__CellMan\.conda\envs\foundationpose\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) File "C:\Users\__CellMan\.conda\envs\foundationpose\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 178, in prepare_metadata_for_build_wheel whl_basename = backend.build_wheel(metadata_directory, config_settings) File "C:\Users\__CellMan\AppData\Local\Temp\pip-build-env-qq50mhk3\overlay\Lib\site-packages\cmeel\build.py", line 26, in build_wheel return build_impl(wheel_directory, editable=False) File "C:\Users\__CellMan\AppData\Local\Temp\pip-build-env-qq50mhk3\overlay\Lib\site-packages\cmeel\impl.py", line 105, in build_impl check_call(build_cmd) File "C:\Users\__CellMan\.conda\envs\foundationpose\lib\subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', 'C:\\Users\\__CELL~1\\AppData\\Local\\Temp\\cmeel-1somp3uw\\bld', '-j4']' returned non-zero exit status 1. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed Encountered error while generating package metadata. See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
最新发布
07-11
<think>好的,我需要帮用户解决MSB6006编译错误的问题。用户遇到了“cmd.exe退出代码1的情况。根据提供的引用,这个问题通常和文件访问权限、路径配置或者项目设置有关。首先,我应该整理这些引用中的解决方法,分步骤呈现给用户。 首先,引用[2]提到错误前一句是“Could not create output file”,这提示输出文件无法创建。可能的原因包括文件被占用、权限不足或路径错误。需要检查输出目录是否有写入权限,确认没有其他程序占用生成的文件,比如杀毒软件可能阻止写入。 接下来,引用[3]、[4]、[5]涉及Qt项目的问题,特别是环境变量QTDIR未正确设置或在VS中没有生效。解决方法包括手动在.vcxproj.user文件中设置QTDIR,或者将项目转换为Qt项目。用户可能需要检查Qt的配置,确保VS能正确识别Qt的路径。 然后,引用[1]和[3]都提到需要检查编译日志中的具体错误信息。用户应该查看错误发生前的输出,找到更详细的错误描述,比如文件缺失或路径错误。例如,引用[4]中的“Cannot open include file: 'QtCore/qglobal.h'”说明头文件路径不正确,需要正确配置Qt的包含路径。 另外,可能需要检查项目属性中的路径设置,确认所有自定义生成步骤的命令是否正确,特别是涉及第三方工具或自定义脚本的情况。引用[5]提到右键项目没有转换选项,但通过其他方式解决了问题,可能涉及到项目配置的调整或重新导入Qt插件。 最后,建议用户逐步排查:检查输出目录权限、确认依赖项路径正确、检查环境变量和项目设置、查看详细日志定位具体错误。如果问题依然存在,尝试清理解决方案并重新生成,或者重启VS以确保环境变量生效。</think>### MSB6006编译错误解决方案 MSB6006错误通常由文件访问问题、环境配置错误或生成步骤失败导致。以下是分步解决方案: #### 一、检查文件访问权限 1. **确认输出文件未被占用** - 查看错误信息前一句提示(如`Could not create output file`),定位无法生成的文件路径[^2] - 关闭占用文件的程序(如杀毒软件、IDE或其他进程) - 删除`bin`和`obj`文件夹后重新生成 2. **验证路径有效性** - 检查输出路径是否包含特殊字符(如空格、中文) - 确保路径长度不超过Windows限制(260字符) #### 二、Qt项目特殊处理(如涉及Qt开发) 1. **配置Qt环境变量** - 手动在`.vcxproj.user`文件中添加QTDIR变量: ```xml <PropertyGroup> <QTDIR>C:\Qt\5.15.2\msvc2019</QTDIR> </PropertyGroup> ``` 需根据实际安装路径修改[^3][^4] - 重启Visual Studio使配置生效 2. **转换项目类型** - 右键项目选择`Convert to Qt Add-in Project`[^5] - 若选项缺失,通过Qt VS Tools菜单重新加载项目 #### 三、检查生成步骤 1. **验证自定义生成事件** - 打开项目属性 → 生成事件 → 检查预/后期生成事件命令 - 测试命令在CMD中能否独立执行 2. **排查第三方工具链** - 检查涉及的外部工具路径(如make、moc编译器) - 确认工具版本与项目要求匹配 #### 四、通用排查流程 ```mermaid graph TD A[出现MSB6006错误] --> B{查看错误上下文} B --> |识别具体错误描述| C[文件访问问题] B --> |识别具体错误描述| D[环境配置错误] C --> E[检查文件权限/路径] D --> F[验证环境变量/项目设置] E --> G[清理解决方案后重试] F --> G G --> H{问题是否解决?} H --> |否| I[检查详细编译日志] I --> J[根据具体错误代码搜索解决方案] ``` #### 五、典型场景示例 - **场景1:缺少Qt头文件** 错误提示:`Cannot open include file: 'QtCore/qglobal.h'` 解决方案: 1. 在项目属性 → C/C++ → 常规 → 附加包含目录添加`$(QTDIR)\include` 2. 确保资源文件正确包含`.qrc`文件[^4] - **场景2:环境变量未生效** 即使系统环境变量已设置QTDIR,仍需在VS项目属性中显式声明路径[^3]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值