Flymake配置错误而编程用C [英] Flymake configuration error while programming in C
问题描述
当试图运行M-X Flymake模式在Emacs我得到:
When trying to run M-x Flymake-Mode in Emacs I get:
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命令:
I am invoking the command in a buffer called helloworld.c:
#include <stdio.h>
int main(void) {
printf("Hello World");
return 0;
}
和有一个叫Makefile文件在同一目录下的文件:
And have a file called Makefile in the same directory:
helloworld: helloworld.c
gcc helloworld.c -o helloworld
我运行GNU Emacs的23.0.91.1 Ubuntu的9.04之下。
I'm running GNU Emacs 23.0.91.1 under Ubuntu 9.04.
在此先感谢!
推荐答案
的Makefile'必须包含
检查语法的目标。这个附加在Makefile:
Makefile' must contain the
check-syntax' target. Append this to the Makefile:
check-syntax:
gcc -o nul -S ${CHK_SOURCES}
请确保您使用TAB键来启动第二行。也有与flymake,让你有来命名的Makefile以大写M.如果你说了,叫它它不会工作中的错误生成文件。提防!
Make sure you use a TAB to start the second line. Also there is a bug with flymake that makes you have to name the Makefile with a capital M. It won't work if you, say, call it "makefile." Watch out for that!
这篇关于Flymake配置错误而编程用C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!