2012-02-24 51 views
4

我使用:makevim并最终跳转到有问题的文件。Vim试图跳转到不存在的文件之后:make

最近,至少我注意到gcc 4.6.1vim,因为它关系到第一线报道具有"In file included from ABC.h|5| 0,"并没有叫"In file included from ABC.h"文件跳转到不正确的文件/行。

在这种情况下,有一种解决方案仅从上面的行中提取文件名ABC.h,但这并不能解决问题,因为有问题的文件只包含在那里。

通常下一行指示了问题,这就是在那里我想跳:

MyDir/FGH.h|56 col 32| error: 'bad bad thing happened here' 

是否有vim这个已知解决?

回答

4

这是对的Vim的新版本解决了一个错误:Bug report logs - #62169

您可以使用下面的设置来解决该问题,而不升级的Vim:

set errorformat^=%-GIn\ file\ included\ from\ %f:%l:%c:,%-GIn\ file 
      \\ included\ from\ %f:%l:%c\\,,%-GIn\ file\ included\ from\ %f 
      \:%l:%c,%-GIn\ file\ included\ from\ %f:%l 

(设置从最新的Vim的源代码中提取,从文件src/option.h

+0

+1,非常感谢!,这对我有用,我在vim 7.3 – stefanB 2012-09-21 00:37:09

+0

@stefanB:你受欢迎的 :) – mMontu 2012-09-21 20:45:43

2

:make!不会跳到第一个结果。

+1

,这不是实际的问题,尽管它_is_我使用的解决方法 – sehe 2012-02-24 10:04:09

+0

但我想跳到第一个结果!感谢指出它,我一直想寻找这个,但只是找不到足够的时间...主要是我想跳到第一个错误/警告(并修复它)... – stefanB 2012-02-24 15:09:33

+0

+1向我展示我从来没有时间寻找的选项:) – stefanB 2012-09-21 00:38:23

1

问题是在最近版本的gcc所需的错误格式中略有差异。

我相信这是前几天在C++ Lounge(聊天室)中提到的,并且发布了错误格式,可能会更好。 我没有测试它的确

  • http://chat.stackoverflow.com/search?q=errorformat&room=10

    errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GInfile included from %f:%l:%c:,%-GIn file included from %f:%l:%c\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f',%X%*\a[%*\d]: Leaving directory `%f',%D%*\a: Entering directory `%f',%X%*\a: Leaving directory `%f',%DMaking %*\a in %f,%f|%l| %m 
    
+0

+1,我会尝试... – stefanB 2012-02-24 15:16:40

相关问题