【问题标题】:clang does not compile a simple c fileclang 不会编译一个简单的 c 文件
【发布时间】:2012-02-24 08:14:35
【问题描述】:

我刚刚在 cygwin 中安装了 clang: clang 3.1 版(主干 151024) TargetL i386-pc-cygwin 线程模型:posix

但是当试图编译一个简单的 c 文件(只有 main)时,出现了错误:

clang version 3.1 (trunk 151024)
Target: i386-pc-cygwin
Thread model: posix
 "/usr/local/bin/clang" -cc1 -triple i386-pc-cygwin -S -disable-free -main-file-name t.c -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-cpu pentium4 -momit-leaf-frame-pointer -v -resource-dir /usr/local/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -fno-dwarf-directory-asm -fdebug-compilation-dir /toolchain4 -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-use-cxa-atexit -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -o /cygdrive/c/Users/Br0ther/AppData/Local/Temp/t-zyOz8h.s -x c t.c
clang: error: unable to execute command: Program could not be executed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information.
clang: error: unable to execute command: Program could not be executed
clang: note: diagnostic msg: Error generating preprocessed source(s).

任何人都知道是什么导致了问题吗?我不知道消息的含义是什么:

clang: error: unable to execute command: Program could not be executed
clang: error: clang frontend command failed due to signal (use -v to see invocation)

非常感谢您的帮助 NK

【问题讨论】:

  • 您是否尝试按照建议运行clang -v -c yoursource.c

标签: objective-c c cygwin llvm clang


【解决方案1】:

如果这两行让你担心:

clang: error: unable to execute command: Program could not be executed
clang: error: clang frontend command failed due to signal
    (use -v to see invocation)

那么我可以建议您(如错误消息中的建议)更改您的命令以查看它使用的调用行:

"/usr/local/bin/clang" -v -cc1 -triple i386-pc-cygwin ...

然后您将知道该程序的名称,并且您可以调查为什么它不在您的路径上(例如)。

【讨论】:

    【解决方案2】:

    感谢您的所有建议。 不过这个问题已经被 cygwin 的increasing the heap size 修复了。

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-05
      • 2021-08-26
      • 2013-12-25
      • 2015-07-07
      相关资源
      最近更新 更多