尝试打开C文件时出现Clang错误

4

我最近下载了vim并使用C语言编写了一个简单的Hello World程序。在使用cmd时,我发现Gcc出错了,于是安装了clang,但它也出错了。我还安装了cygwin,并尝试了两个编译器,但仍然没有解决问题。

我一直得到这些错误信息:

 1 [main] clang 304 child_info_fork::abort: C:\cygwin\bin\cygLLVM-3.5.dll:
 Loaded to different address: parent(0x1A10000) != child(0x1710000) clang:
 error: unable to execute command: posix_spawn failed: Resource temporarily
 unavailable

我认为clang比gcc更有希望。


这是一个不寻常的错误!我建议您的cygwin安装中存在某些损坏。您尝试过从头开始重新安装所有内容吗? - autistic
有其他建议吗?我真的不想使用IDE甚至制作自己的编译器xD。我尝试了多次重新安装,还有其他事情可以做吗? - ExZya
请描述您的重新安装过程。有可能您正在从已损坏的缓存源中提取二进制文件,并且这些文件在下载时就已经损坏,而且没有重新下载。在尝试重新安装之前,您是否删除了安装的每个部分 - autistic
1
您IP地址为143.198.54.68,由于运营成本限制,当前对于免费用户的使用频率限制为每个IP每72小时10次对话,如需解除限制,请点击左下角设置图标按钮(手机用户先点击左上角菜单按钮)。 - thurizas
1
愚蠢的问题时间:你上次重启是什么时候?你的机器有多少内存? - Jonathan Leffler
显示剩余2条评论
1个回答

2

简短回答: 如果你的Cygwin安装直接在C盘下,关闭Cygwin并在Windows命令提示符中尝试执行此命令:

C:\cygwin\bin\dash.exe -c '/usr/bin/rebaseall -v'

这是一个Cygwin的fork失败

如上面链接所述,其中一种解决方法是进行'rebase':

阅读'/usr/share/doc/rebase/'中的'rebase'包README,并按照那里的说明运行'rebaseall'。

根据README:

Use the following procedure to rebase your entire system:

    1. shutdown all Cygwin processes and services
    2. start ash or dash (do not use bash or a terminal emulator like rxvt
       or mintty). The easiest way to do this is to use Windows Explorer
       and navigate to the top level of your cygwin installation, and
       double-click ash.exe or dash.exe in the bin/ directory.
    3. execute /bin/rebaseall (in the ash/dash window)

If you get any errors due to DLLs being in-use or read-only, then take the
appropriate action and rerun rebaseall.  Otherwise, you run the risk of fork()
failing.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接