C1803:ERROR Cannot open precompiled header file: 'Debug/XXX.pch': No such file or directory

VC预编译头文件问题
本文介绍了解决VC编译过程中预编译头文件找不到的错误提示问题的方法。通过设置项目的预编译头文件选项为自动使用预编译头文件,并指定stdafx.h作为预编译头文件的方式,有效解决了这一常见问题。

用vc的人可能遇到过"fatal error C1083: Cannot open precompiled header file: 'Debug/xxx.pch': No such file or directory,"的问题吧.

我刚前不久遇到这个问题,搞的头都大了,我在网上找了些资料说

在Project ->Settings->C/C++->Category->precompiled Headers中选

"Create precompiled header file(.pch)"

我试过有时没用.

我建议选用"Automatic use of precomplied headers"  在"Through header:"中用stdafx.h

这样就要解决这个问题了.

 

PS C:\Users\admin> cd D:\download\RedDino-main PS D:\download\RedDino-main> pip install -r requirements.txt Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://download.pytorch.org/whl/cu117, https://pypi.nvidia.com Requirement already satisfied: torch>=2.6.0 in c:\users\admin\anaconda3\lib\site-packages (from -r requirements.txt (line 2)) (2.9.1) Collecting torchvision>=0.21.0 (from -r requirements.txt (line 3)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/5c/ec/54a96ae9ab6a0dd66d4bba27771f892e36478a9c3489fa56e51c70abcc4d/torchvision-0.24.1-cp313-cp313-win_amd64.whl (4.3 MB) Collecting omegaconf (from -r requirements.txt (line 4)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e3/94/1843518e420fa3ed6919835845df698c7e27e183cb997394e4a670973a65/omegaconf-2.3.0-py3-none-any.whl (79 kB) Collecting torchmetrics==0.10.3 (from -r requirements.txt (line 5)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/08/b7/f1e49be0e076c8ec981f1d4cea1f32da2bd754eaeaf6ed74d5add3f840b4/torchmetrics-0.10.3-py3-none-any.whl (529 kB) Collecting fvcore (from -r requirements.txt (line 6)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a5/93/d056a9c4efc6c79ba7b5159cc66bb436db93d2cc46dca18ed65c59cc8e4e/fvcore-0.1.5.post20221221.tar.gz (50 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting iopath (from -r requirements.txt (line 7)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/72/73/b3d451dfc523756cf177d3ebb0af76dc7751b341c60e2a21871be400ae29/iopath-0.1.10.tar.gz (42 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting xformers>=0.0.22 (from -r requirements.txt (line 8)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a9/ef/4f59589fe37e206f5bb6158aa1294cfa0e79d52bca99ea0fd3f5c8a73404/xformers-0.0.33.post1-cp39-abi3-win_amd64.whl (105.1 MB) Collecting submitit (from -r requirements.txt (line 9)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/db/80/90e0a0f4008f6572de58b042b1db9daced15d348a3586dda5efc9faba65e/submitit-1.5.3-py3-none-any.whl (75 kB) Requirement already satisfied: numpy>=1.17.2 in c:\users\admin\anaconda3\lib\site-packages (from torchmetrics==0.10.3->-r requirements.txt (line 5)) (2.1.3) Requirement already satisfied: packaging in c:\users\admin\anaconda3\lib\site-packages (from torchmetrics==0.10.3->-r requirements.txt (line 5)) (24.2) Requirement already satisfied: filelock in c:\users\admin\anaconda3\lib\site-packages (from torch>=2.6.0->-r requirements.txt (line 2)) (3.17.0) Requirement already satisfied: typing-extensions>=4.10.0 in c:\users\admin\anaconda3\lib\site-packages (from torch>=2.6.0->-r requirements.txt (line 2)) (4.12.2) Requirement already satisfied: sympy>=1.13.3 in c:\users\admin\anaconda3\lib\site-packages (from torch>=2.6.0->-r requirements.txt (line 2)) (1.13.3) Requirement already satisfied: networkx>=2.5.1 in c:\users\admin\anaconda3\lib\site-packages (from torch>=2.6.0->-r requirements.txt (line 2)) (3.4.2) Requirement already satisfied: jinja2 in c:\users\admin\anaconda3\lib\site-packages (from torch>=2.6.0->-r requirements.txt (line 2)) (3.1.6) Requirement already satisfied: fsspec>=0.8.5 in c:\users\admin\anaconda3\lib\site-packages (from torch>=2.6.0->-r requirements.txt (line 2)) (2025.3.2) Requirement already satisfied: setuptools in c:\users\admin\anaconda3\lib\site-packages (from torch>=2.6.0->-r requirements.txt (line 2)) (72.1.0) Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in c:\users\admin\anaconda3\lib\site-packages (from torchvision>=0.21.0->-r requirements.txt (line 3)) (11.1.0) Collecting antlr4-python3-runtime==4.9.* (from omegaconf->-r requirements.txt (line 4)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/3e/38/7859ff46355f76f8d19459005ca000b6e7012f2f1ca597746cbcd1fbfe5e/antlr4-python3-runtime-4.9.3.tar.gz (117 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: PyYAML>=5.1.0 in c:\users\admin\anaconda3\lib\site-packages (from omegaconf->-r requirements.txt (line 4)) (6.0.2) Collecting yacs>=0.1.6 (from fvcore->-r requirements.txt (line 6)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/38/4f/fe9a4d472aa867878ce3bb7efb16654c5d63672b86dc0e6e953a67018433/yacs-0.1.8-py3-none-any.whl (14 kB) Requirement already satisfied: tqdm in c:\users\admin\anaconda3\lib\site-packages (from fvcore->-r requirements.txt (line 6)) (4.67.1) Collecting termcolor>=1.1 (from fvcore->-r requirements.txt (line 6)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f9/d5/141f53d7c1eb2a80e6d3e9a390228c3222c27705cbe7f048d3623053f3ca/termcolor-3.2.0-py3-none-any.whl (7.7 kB) Requirement already satisfied: tabulate in c:\users\admin\anaconda3\lib\site-packages (from fvcore->-r requirements.txt (line 6)) (0.9.0) Collecting portalocker (from iopath->-r requirements.txt (line 7)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4b/a6/38c8e2f318bf67d338f4d629e93b0b4b9af331f455f0390ea8ce4a099b26/portalocker-3.2.0-py3-none-any.whl (22 kB) INFO: pip is looking at multiple versions of xformers to determine which version is compatible with other requirements. This could take a while. Collecting xformers>=0.0.22 (from -r requirements.txt (line 8)) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d4/4d/40daad1068fb19291598bb656d7441c157bd04803c3534df05641889730e/xformers-0.0.33-cp39-abi3-win_amd64.whl (8.3 MB) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/50/19/ea64609a535f87a44cb177dc37c6d6a58f6d540adfff819d565fb0657cf7/xformers-0.0.32.post2-cp39-abi3-win_amd64.whl (100.2 MB) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/91/70/7dee5a786d77a63cf20dac60c38086bd2202d59ae89c8acef0ef6331c374/xformers-0.0.32.post1-cp39-abi3-win_amd64.whl (100.2 MB) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ff/ba/e953b24cc6e1ac3798d8ac16565b0c63c050df3b8130df752e70e1ce98ed/xformers-0.0.31.post1-cp39-abi3-win_amd64.whl (100.2 MB) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b5/66/7b60ec52da94a0da3383ba385b43e42cee8854c001b5cb6cf98a909665c8/xformers-0.0.31-cp39-abi3-win_amd64.whl (100.2 MB) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bf/f7/dd2269cce89fd1221947dd7cc3a60707ffe721ef55c1803ac3b1a1f7ae5c/xformers-0.0.30.tar.gz (10.2 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [23 lines of output] Traceback (most recent call last): File "C:\Users\admin\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module> main() ~~~~^^ File "C:\Users\admin\anaconda3\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\admin\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\admin\AppData\Local\Temp\pip-build-env-qegqy3qh\overlay\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admin\AppData\Local\Temp\pip-build-env-qegqy3qh\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires self.run_setup() ~~~~~~~~~~~~~~^^ File "C:\Users\admin\AppData\Local\Temp\pip-build-env-qegqy3qh\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admin\AppData\Local\Temp\pip-build-env-qegqy3qh\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) ~~~~^^^^^^^^^^^^^^^^ File "<string>", line 24, in <module> ModuleNotFoundError: No module named 'torch' [end of output] note: This error originates from a subprocess, and is likely not a problem wi
最新发布
11-26
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wangzai117

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值