Windows子系统(Linux)(WSL)下的间歇性随机“找不到文件"错误 [英] Intermittent, random 'file not found' errors under Windows Subsystem for Linux (WSL)

查看:946
本文介绍了Windows子系统(Linux)(WSL)下的间歇性随机“找不到文件"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当包含C ++头文件时,我正在间歇性发生致命错误:...未找到文件"错误,该错误在Windows Subsystem for Linux(WSL)中运行的Ubuntu 16.04.2下使用gcc 4.8或clang 3.8构建C ++应用程序,但是自几天前安装Windows 10 April更新(版本1803,操作系统内部版本17134.1)以来.

I'm getting intermitting 'fatal error: ... file not found' errors building C++ application using either gcc 4.8 or clang 3.8 under Ubuntu 16.04.2 running in Windows Subsystem for Linux (WSL), when including C++ header files, but only since installing the Windows 10 April update (Version 1803, OS Build 17134.1) a few days ago.

来自clang编译器的错误消息示例:

Example error message from clang compiler:

fatal error: 'boost/preprocessor/list/fold_left.hpp' file not found

来自gcc编译器的错误消息示例:

Example error message from gcc compiler:

fatal error: boost/mpl/aux_/at_impl.hpp: No such file or directory

我说该错误是间歇性的,因为如果我重新运行该构建,则打断该构建的特定错误将消失,并且该构建运行了一段时间,直到它成功构建或随机未能包含其他文件.相同的找不到文件"错误.

I say the error is intermittent because if I re-run the build, the particular error that interrupted the build disappears, and the build runs for a while longer until it either builds successfully or randomly fails to include some other file with the same kind of 'file not found' error.

此故障的发生时间及其随机性使我怀疑这是WSL中的一个新错误.其他人看到此消息或对如何解决它有建议吗?

The timing of this fault and the randomness of it make me suspect it is a new bug in WSL. Anyone else seeing this or have suggestions on how to fix it?

错误并不总是出现在Boost包含中,而仅仅是因为Boost占了整个包含文件的很大一部分.正在构建的文件位于/mnt/d/下的共享卷上.

The error is not always in a Boost include, but often is simply because Boost comprises a large proportion of the overall include files. The files being built exist on a shared volume under /mnt/d/.

推荐答案

已被识别为多线程错误(

This has been identified as a multithreading bug (https://docs.microsoft.com/en-us/windows/wsl/release-notes#build-17655-skip-ahead) and should get fixed in a future windows update.

由于它是一个多线程错误,因此有可能通过不使用多线程构建来解决.

Since it's a multithreading bug, it might be possible to work around it by not using multithreaded builds.

如果着急,有可能只是进入Windows Insider程序并使用其中一个预览版本.

If in a hurry, it might be possible to just get to the windows insider program and use one of the preview builds.

这篇关于Windows子系统(Linux)(WSL)下的间歇性随机“找不到文件"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆