繁体   English   中英

用C编程时Flymake配置错误

[英]Flymake configuration error while programming in C

尝试在Emacs中运行Mx Flymake-Mode时,我得到:

Flymake: Configuration error has occured while running (make -s -C ./CHK_SOURCES=helloworld_flymake.c SYNTAX_CHECK_MODE=1 check-syntax). Flymake will be switched OFF

我在名为helloworld.c的缓冲区中调用命令:

#include <stdio.h>

int main(void) {
  printf("Hello World");
  return 0;
}

并在同一目录中有一个名为Makefile的文件:

helloworld: helloworld.c
 gcc helloworld.c -o helloworld

我正在Ubuntu 9.04下运行GNU Emacs 23.0.91.1。

提前致谢!

Makefile' must contain the check-syntax”目标。 将此附加到Makefile:

check-syntax:
     gcc -o nul -S ${CHK_SOURCES}

确保使用TAB开始第二行。 另外,flymake的一个错误使您必须用大写的M命名Makefile。如果您将其称为“ makefile”,则该命令将无效。 注意这一点!

这是您的makefile的实际内容吗? 看起来第二行之前有一个空格''。 这应该是一个选项卡:

helloworld: helloworld.c
 gcc helloworld.c -o helloworld

更像这样:

helloworld: helloworld.c
    gcc helloworld.c -o helloworld

请记住,SO编辑器似乎已将我的制表符转换为空格,所以不要这样做。

helloworld: helloworld.c
<press tab here>gcc helloworld.c -o helloworld

暂无
暂无

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

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