# vim quickfix + gcc



## graudeejs (Oct 17, 2009)

In vim there is section
*:help quickfix*

I tried it several times in my project, but for some reasons, Vim captures wrong errors....

Does it work for anyone?

here's output of simple make (in console)

```
cc -O2 -pipe -march=pentiumpro -Wall -std=c99 -I/usr/include -I/usr/local/include -lglut -lGLU -lGL -lXmu -lXi -lXext -lX11 -lm -L/usr/lib -L/usr/local/lib main.c -o sd1
[B]main.c: In function 'RenderScene':
main.c:29: warning: implicit declaration of function 'lRectf'
/var/tmp//ccR1SUrD.o(.text+0x183): In function `RenderScene':
: undefined reference to `lRectf'[/B]
*** Error code 1

Stop in /home/killasmurf86/devel/ddd-sd1.
```
Bold text is redirected to stderr

What vim captures is:

```
|| cc -O2 -pipe -march=pentiumpro -Wall -std=c99 -I/usr/include -I/usr/local/include -lglut -lGLU -lGL -lXmu -lXi -lXext -lX11 -lm -L/usr/lib -L/usr/local/lib main.c -o sd1
|| *** Error code 1
|| 
|| Stop in /home/killasmurf86/devel/ddd-sd1.
```

I wonder if quickfix works for anyone by default, or do I have to create my own errorformat


The way I see it, vim should capture stderr


----------



## graudeejs (Oct 17, 2009)

OK, after many experiments I fixed this by adding this line to
~/.vimrc

```
set shell=/bin/sh
```


----------

