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

Re: problems setting up makeprg and makeef

Expand Messages
  • Ben Fritz
    ... I agree, but I think getting the cd command correct might actually fix this problem, because possibly the OP s make program will not output the full path
    Message 1 of 10 , Mar 7, 2013
      On Thursday, March 7, 2013 12:51:46 PM UTC-6, Gary Johnson wrote:
      > On 2013-03-07, FlashBurn wrote:
      >
      > > shell returned2
      >
      > > E303: Unable to open swap file for "and Settings\user\Projects\MyProject\trunk\src\myfile.c
      >
      > > "and Settings\user\Projects\MyProject\trunk\src\myfile.c,60 Error"[New DIRECTORY]
      >
      > >
      >
      > > Does anybody know what is going on and how I can fix it? Any help
      >
      > > is appreciated.
      >
      >
      >
      > This looks like a problem with your 'errorformat'. The compiler
      >
      > found an error at line 60 of myfile.c, but your 'errorformat' is
      >
      > incorrectly parsing that message so that Vim tries to jump to an
      >
      > error in a file named
      >
      > "and Settings\user\Projects\MyProject\trunk\src\myfile.c,60 Error".
      >

      I agree, but I think getting the "cd" command correct might actually fix this problem, because possibly the OP's make program will not output the full path if it's already running from a directory within that path. But that might be wishful thinking on my part.

      Note that E303 can be caused on Windows 7 because Vim looks in C:\Temp and C:\TMP rather than $TEMP and $TMP for swap files by default; you can fix this by modifying your 'directory' option. But, Vim will still be looking in the wrong location for the file itself. And, Windows 7 has "C:\Users\blah" instead of "C:\Documents and Settings\blah" so it's not as likely to be the cause in this case.

      --
      --
      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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Jia Shi
      ... The reason for E40 is that make didn t execute successfully for some reason and that temp file didn t get generated, so it failed to open as it was not
      Message 2 of 10 , Jul 12, 2015
        On Thursday, March 7, 2013 at 2:02:40 AM UTC+8, FlashBurn wrote:
        > I have setup a vim script to do the following
        >
        > " Setup the project home directory.
        > let s:project_path = 'C:\Documents and Settings\user\Projects\myproject\trunk'
        >
        > " Setup the project home directory such that Vim can understand it. It will
        > " escape white spaces.
        > let s:vim_project_path = fnameescape(s:project_path)
        > " cd to the project directory.
        > set cd=s:vim_project_path
        >
        > " Setup make command such that shell can understand it.
        > " Path to make.exe.
        > let &makeprg = shellescape(s:project_path.'\tools\make.exe')
        > " Use makefile from 'src\makefile'.
        > let &makeprg .= ' -f '.shellescape(s:project_path.'\src\makefile')
        > " Change to a directory 'src' before running make.
        > let &makeprg .= ' --directory '.shellescape(s:project_path.'\src')
        >
        > " Setup the file where the output of ':make' will be redirected.
        > let &makeef = shellescape(s:project_path.'\src\error.err')
        >
        > But for some reason whenever I run :make, I'm getting the following error
        >
        > E40: Can't open errofile :C:/Documents and Settings/user/Projects/myproject/trunk/src/error.err"
        >
        > I looked at help for E40 but nothing really can explain why this is happening.
        >
        > Now if my makeef is setup as follows
        > let &makeef = ""
        >
        > Then Windows redirects the output to a temporary file and there are no issues. I'd like to be able to store the output in a given file not in a temporary file.
        >
        > Does anybody know what is the issue and how it can be fixed?
        >
        > Any help is appreciated.

        The reason for E40 is that make didn't execute successfully for some reason and that temp file didn't get generated, so it failed to open as it was not exist.

        And why make didn't execute successfully? Probably you have broken the command line string limitation: https://support.microsoft.com/en-us/kb/830473, and one workaround is to use 8.3 short path format, as you tried, but probably you are not aware of that limitation.

        --
        --
        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

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      Your message has been successfully submitted and would be delivered to recipients shortly.