MSVC compiler 1024-char limit

Help
muukke
2005-02-28
2013-04-24
  • muukke
    muukke
    2005-02-28

    I'm running into the 1024 character dos command-line limit when compiling large projects.  I have lots of include directories with large path names.  I see that response files are written in CommandLineLinker for this issue, is there an equivalent .rsp file for CommandLineCompiler or some other workaround?

     
    • Curt Arnold
      Curt Arnold
      2005-02-28

      The compiler adapter adjusts the number of files compiled per compiler invocation to stay within the limit.  It should only be a problem if you are unable to compile even one file without going over 1024 characters.

       
      • muukke
        muukke
        2005-03-01

        Looks like that's the case, I dumped out the command string and arguments and I have too many include directories for even a single file.  My source code is buried deep in the development file structure.  I'll try building separate static libraries then linking them together at the end.

        Simultaneously creating a response file and dynamically sizing the number of files to compile looks like a complicated task unless a dedicated response-file attribute is added.  I'll try my first fix for now and curse Microsoft under my breath. :)

         
        • Curt Arnold
          Curt Arnold
          2005-03-01

          I haven't been able to find a definitive guide on the command line length supported by various Microsoft OS's.  If you are running a later version of Windows, you may have a max command line length substantially greater than 1024.  You may try upping the value returned by DevStudioCCompiler.getMaximumCommandLength() and see if you run into problems on your version.

           
          • Nick Richards
            Nick Richards
            2005-04-07

            Win98's command.com (also available under win2k) allows from 128 to 1024 characters.

            Win2k+ has some unknown upper limit.

            I get this:
            "Extremely long file name, can't fit on command line"
            and am trying to workaround it now.  (changing the getMaximumCommandLength() result...)

            Wish me luck!

             
            • Nick Richards
              Nick Richards
              2005-04-08

              Lucky!  Worked fine.

              Used jad to decompile quickly.  Fun stuff.

               
    • Nick Richards
      Nick Richards
      2005-04-11

      Final solution - dump my compiler configurations to a temp file.

      Perhaps cpptasks could help me to automate this?  I don't like having to use <echo file=""> when I have all the cpptasks elements at my disposal.

       
      • Markus Wankus
        Markus Wankus
        2005-04-11

        I noticed in another post you also mention "decompiling" with Jad...

        Why don't you just download the source, and insert a breakpoint??

        M.