2016-05-10 11 views
0

私はvimでmakeを実行すると、唯一のcppファイル(main.cpp)にエラーがある場合、vimは私にエラーを表示し、Enterを押すと、vimでメイクした後の空白ファイル

^[[H^[[Jmain.cpp 
代わり

main.cpp 

そして私は手動で自分のファイルを再度開く必要があります。 vimに正しいファイルを開く方法を教えてください。

私が実行している

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 20 2016 11:17:28) 
MacOS X (unix) version 
Included patches: 1-1655 Compiled by Homebrew 

エラー出力:(によって報告されるように:&エラーフォーマットエコー)

main.cpp:40:2: error: unknown type name 'obvious' 
     obvious error 
     ^
main.cpp:40:15: error: expected ';' at end of declaration 
     obvious error 
        ^
        ; 
2 errors generated. 
rm: main: No such file or directory 
make: *** [all] Error 1 

Press ENTER or type command to continue 

Vimのエラーフォーマット

%*[^"]"%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.),%-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,%-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

'errorformat'の値だけでなく、コンパイラの完全な出力を追加できますか? – romainl

答えて

0

のMakefileはこのようなものを見て:

all: 
    clear && g++ main.cpp -o main 

そしてクリアはそれを投げているようです。回避策は、クリアを削除するか、後でエコーを追加することです

all: 
    g++ main.cpp -o main 

all2: 
    clear && echo "" && g++ main.cpp -o main 
関連する問題