2012-02-24 22 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

相關問題