Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

flymake configuration error for C program

308 views
Skip to first unread message

Corey Foote

unread,
Sep 6, 2009, 4:35:36 PM9/6/09
to help-gn...@gnu.org
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

I am invoking the command in a buffer called helloworld.c:

#include <stdio.h>

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

And have a file called Makefile in the same directory:

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

I'm running GNU Emacs 23.0.91.1 under Ubuntu 9.04.

Thanks in advance!



Hotmail® is up to 70% faster. Now good news travels really fast. Try it now.

Corey Foote

unread,
Sep 6, 2009, 4:40:10 PM9/6/09
to help-gn...@gnu.org
And, of course, I'm using tabs in the makefiile as necessary. It compiles fine when I just run "make" from the shell.


From: corey...@hotmail.com
To: help-gn...@gnu.org
Date: Sun, 6 Sep 2009 16:35:36 -0400
Subject: flymake configuration error for C program

Windows Live: Keep your friends up to date with what you do online. Find out more.

Anselm Helbig

unread,
Sep 6, 2009, 6:20:23 PM9/6/09
to
At Sun, 6 Sep 2009 16:40:10 -0400,
Corey Foote <corey...@hotmail.com> wrote:
>
> [1 <text/plain; iso-8859-1 (quoted-printable)>]
>
> [2 <text/html; iso-8859-1 (quoted-printable)>]

> And, of course, I'm using tabs in the makefiile as necessary. It compiles fine when I just run "make" from the shell.
>
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

> From: corey...@hotmail.com
> To: help-gn...@gnu.org
> Date: Sun, 6 Sep 2009 16:35:36 -0400
> Subject: flymake configuration error for C program
>
> 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
>
> I am invoking the command in a buffer called helloworld.c:
>
> #include <stdio.h>
>
> int main(void) {
> printf("Hello World");
> return 0;
> }
>
> And have a file called Makefile in the same directory:
>
> helloworld: helloworld.c
> gcc helloworld.c -o helloworld
>
> I'm running GNU Emacs 23.0.91.1 under Ubuntu 9.04.

Running make like this fails for me:

make -s -C ./ CHK_SOURCES=helloworld_flymake.c SYNTAX_CHECK_MODE=1 check-syntax

You need to expand your makefile to have a check-syntax target, which
should take the name of the file you're editing in CHK_SOURCES.

Set this if you want to get some logging from flymake in your
*Messages* buffer:

(setq flymake-log-level 3)

HTH,

Anselm


--
Anselm Helbig
mailto:anselm.helb...@googlemail.com

Andreas Politz

unread,
Sep 6, 2009, 6:23:42 PM9/6/09
to help-gn...@gnu.org
Corey Foote <corey...@hotmail.com> writes:

> 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

I tried this today as well. Here is the answer :


,----[ (info "(flymake) Example -- Configuring a tool called via make") ]
|
| Thus, `Makefile' must contain the `check-syntax' target. In our case
| this target might look like this:
|
| check-syntax:
| gcc -o nul -S ${CHK_SOURCES}
`----

-ap

0 new messages