quickfix, gcc and multiple directories

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

quickfix, gcc and multiple directories

SoulSkorpion
I'm trying to set up quickfix\make\errorformat, and I've run into a
problem when multiple directories are involved. With a c++ project of
mine, I have things set so that the source files are in a seperate
folder from where the .o files are sent. The problem is if there's a
linker error along the lines of this:

main.o(.data$_ZTV8DoomMenu+0x2c):main.cpp: undefined reference to
`DoomMenu::Input(SDLKey)'

What I want is to be able to jump to main.cpp from the quickfix window.
The problem is that main.o and main.cpp are not in the same directory,
so quickfix will open a blank main.cpp instead of the right one.

"_vimrc
set errorformat=%DEntering\ directory\ `%f',%DLeaving\ directory\
`%f',%.%#.o(%.%#):%f:%m,%f:%l:\ %m

The problem is that the directory of the source file isn't included in
the error message, so I can't retrieve it with a simple one-line
errorformat pattern. What's the best way to get this to work? Is there
some clever hack using echos in the makefile which I could use? Or is
there already a script available that does what I want?

-SoulSkorpion