Loading ...
Sorry, an error occurred while loading the content.

:make isn't catching errors

Expand Messages
  • stillLearningVim
    Hello, I ve downloaded MinGW on Windows 7, so I can compile c++ programs from cmd with the command g++ example.cpp -o run. With vim, :make isn t catching any
    Message 1 of 2 , Jan 1, 2013
    • 0 Attachment
      Hello,

      I've downloaded MinGW on Windows 7, so I can compile c++ programs from cmd with the command g++ example.cpp -o run. With vim, :make isn't catching any errors, or maybe I don't correctly understand how :make works, I'm not really sure.

      In my vimrc I have:
      makeprg=g++\ %\ -o\ run

      When example.cpp contains an error:
      :make gives me "!g++ example.cpp -o run > C:\...\VIeD50B.tmp
      shell returned 1
      Press ENTER or type command to continue"
      :cn gives me "E42: No Errors"

      Thanks in advance!

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Ben Fritz
      ... You probably need to set your errorformat option so Vim knows how to parse the error output. The best way to set both makeprg and errorformat at the same
      Message 2 of 2 , Jan 2, 2013
      • 0 Attachment
        On Tuesday, January 1, 2013 2:06:29 PM UTC-6, stillLearningVim wrote:
        > Hello,
        >
        > I've downloaded MinGW on Windows 7, so I can compile c++ programs from cmd with the command g++ example.cpp -o run. With vim, :make isn't catching any errors, or maybe I don't correctly understand how :make works, I'm not really sure.
        >
        > In my vimrc I have:
        > makeprg=g++\ %\ -o\ run
        >
        > When example.cpp contains an error:
        > :make gives me "!g++ example.cpp -o run > C:\...\VIeD50B.tmp
        > shell returned 1
        > Press ENTER or type command to continue"
        > :cn gives me "E42: No Errors"
        >
        > Thanks in advance!

        You probably need to set your 'errorformat' option so Vim knows how to parse the error output.

        The best way to set both makeprg and errorformat at the same time is using a compiler plugin, for example using ":compiler gcc". Search through the plugins in $VIMRUNTIME/compiler to see if any meet your needs. Otherwise you'll need to set the 'errorformat' option yourself, which can be complicated. See the :help error-file-format section for details.

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.