2

I am quite a novice user with the compiler based projects.

Before posting this question, I got across few similar questions in SO community as below

SO: 1

SO: 2

I am trying to build the obj files from the build.cmd in command prompt as

build.cmd Target_Machine

It is building the .c and .h files but, when building the .obj files it is giving me the below error

"Command line is too long".

Scons: Building terminated because of errors

How to overcome this issue?

halfer
  • 19,824
  • 17
  • 99
  • 186
John
  • 565
  • 8
  • 23
  • I would guess that `build.cmd` joins together, as argument(s), all of your `.obj` files. `cmd.exe` only allows for strings up to `8191` characters for a post [tag:windows-xp] OS, _(`2047` for pre [tag:windows-xp] OS)_. The fixes would be, if your `.obj` files being processed include their paths, then move them to a different location, or otherwise shorten their paths; or if they're named with long names, shorten their names. Alternatively if the processing executable accepts a file as input, modify the script to send the `.obj` files to a file and pass that file in as input instead. – Compo May 12 '20 at 15:26
  • What package are you trying to build? build.cmd is not the "native" way to launch scons? – bdbaddog May 12 '20 at 18:21

1 Answers1

2

There's support for breaking up command lines using TempFileMunge. There's some material on it in the wiki:

https://github.com/SCons/scons/wiki/LongCmdLinesOnWin32

there doesn't seem to be much in the "official documentation", which is a little surprising since I thought this kicked in automatically on Windows. Do look at MAXLINELENGTH in the manpage.

Mats Wichmann
  • 800
  • 6
  • 6