简体   繁体   English

cpp:vfork:资源暂时不可用

[英]cpp: vfork: Resource temporarily unavailable

I have a weird issue I have just got with C++. 我有一个C ++刚遇到的怪异问题。

While I am compiling my program, I am getting this: 在编译程序时,我得到以下信息:

cpp: vfork: Resource temporarily unavailable cpp:vfork:资源暂时不可用

It is in SCO, but I am not sure if it is only a SCO thing or maybe it is to do with all Linux Systems. 它在SCO中,但是我不确定这仅仅是SCO还是与所有Linux系统有关。

I have had a look on several sites, and they say it could be that "basically g++ is trying to create (fork) a new process, and the kernel is saying No" - Touchtecservers answer 我在几个站点上都看过,他们说这可能是“基本上g ++试图创建(分叉)新进程,而内核却说不” -Touchtecservers回答

I asked this question in U&L chat , and they said to ask it here. 我在U&L聊天中问了这个问题,他们说在这里问。

Edit 编辑

I have tried adding: 我尝试添加:

#define vfork fork

To the source file, and that didn't work. 到源文件,那没有用。

The error message is from the compiler itself, not directly anything to do with the source code in the program you are compiling. 该错误消息来自编译器本身,而不与正在编译的程序中的源代码直接相关。 Indeed, because the compiler has been unable to launch the cpp process, your source code has (probably) not been looked at yet. 确实,由于编译器无法启动cpp进程,因此您的源代码(可能)尚未被查看。 It's slightly unusual that it is cpp that is reported as the process name; 报告为进程名称的是cpp ,这有点不寻常。 I'd expect it to be the cc compiler driver that launched cpp (so it would normally report cc: vfork: Resource temporarily unavailable ). 我希望它是启动cppcc编译器驱动程序(因此它通常会报告cc: vfork: Resource temporarily unavailable )。

Basically, the machine is trying to do too much and doesn't have the resources left over to fork a new process. 基本上,机器正在尝试做太多事情,并且没有剩余资源来分叉新进程。 If you're running a make -j8 to do parallel compilations, maybe you should reduce the 8 to 4 . 如果您正在运行make -j8进行并行编译,则可能应将8减少到4 Otherwise, look at what else is going on the machine that you can stop. 否则,请查看您可以停止的计算机上发生的其他事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM