www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - The input line is too long - critical

reply Arcane Jill <Arcane_member pathlink.com> writes:
I just got this error from the DMD linker: "The input line is too long".

True, my command line is pretty long - currently it stands at 8482 characters -
and is likely to get MUCH longer, as my current (Unicode) project progresses.

This is a showstopper. What do I do? And is there any chance that the hard-coded
limit on the length of DMD's linker's command line could be lifted? Or at least,
increased to something practically unreachable like a megabyte?

Arcane Jill
Jun 21 2004
next sibling parent "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
Isn't this an artefact of the shell, rather than DMC++?

"Arcane Jill" <Arcane_member pathlink.com> wrote in message
news:cb8l5q$ujm$1 digitaldaemon.com...
 I just got this error from the DMD linker: "The input line is too long".

 True, my command line is pretty long - currently it stands at 8482 characters -
 and is likely to get MUCH longer, as my current (Unicode) project progresses.

 This is a showstopper. What do I do? And is there any chance that the

 limit on the length of DMD's linker's command line could be lifted? Or at

 increased to something practically unreachable like a megabyte?

 Arcane Jill

Jun 22 2004
prev sibling next sibling parent reply "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
Does dmd have an  option-file facility? If not, then it should. :)

"Arcane Jill" <Arcane_member pathlink.com> wrote in message
news:cb8l5q$ujm$1 digitaldaemon.com...
 I just got this error from the DMD linker: "The input line is too long".

 True, my command line is pretty long - currently it stands at 8482 characters -
 and is likely to get MUCH longer, as my current (Unicode) project progresses.

 This is a showstopper. What do I do? And is there any chance that the

 limit on the length of DMD's linker's command line could be lifted? Or at

 increased to something practically unreachable like a megabyte?

 Arcane Jill

Jun 22 2004
parent "Walter" <newshound digitalmars.com> writes:
"Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message
news:cb8m06$1095$1 digitaldaemon.com...
 Does dmd have an  option-file facility? If not, then it should. :)

Yes, it does.
Jun 22 2004
prev sibling next sibling parent reply "Walter" <newshound digitalmars.com> writes:
"Arcane Jill" <Arcane_member pathlink.com> wrote in message
news:cb8l5q$ujm$1 digitaldaemon.com...
 I just got this error from the DMD linker: "The input line is too long".

 True, my command line is pretty long - currently it stands at 8482

 and is likely to get MUCH longer, as my current (Unicode) project

 This is a showstopper. What do I do? And is there any chance that the

 limit on the length of DMD's linker's command line could be lifted? Or at

 increased to something practically unreachable like a megabyte?

Two options: 1) Try using a linker response file, i.e. put the command in a file and link it with filename. 2) Put the .obj files into a library, and link in the library.
Jun 22 2004
next sibling parent reply Arcane Jill <Arcane_member pathlink.com> writes:
In article <cb8vnl$1fec$2 digitaldaemon.com>, Walter says...
Two options:
1) Try using a linker response file, i.e. put the command in a file and link
it with  filename.

Ok, thanks. I'll try that. I assume you mean to just put filename in the linker command line, instead of files to be linked, options, etc., and move the list of files to be linked, options, etc., into filename. That sounds quite workable.
2) Put the .obj files into a library, and link in the library.

Well, of course, I can't do that, can I? I can't make a library because I can't use the linker to make it WITH (because the command line is too long). So, I'm going to try option 1. Many thanks for that. Jill
Jun 22 2004
next sibling parent reply Lars Ivar Igesund <larsivar igesund.net> writes:
Arcane Jill wrote:

2) Put the .obj files into a library, and link in the library.

Well, of course, I can't do that, can I? I can't make a library because I can't use the linker to make it WITH (because the command line is too long). So, I'm going to try option 1. Many thanks for that.

Actually you need to use lib.exe to make a static library (link.exe won't do that for you). Maybe lib.exe is able to make use of larger command lines (haven't tried, though). Lars Ivar Igesund
Jun 22 2004
parent "Walter" <newshound digitalmars.com> writes:
"Lars Ivar Igesund" <larsivar igesund.net> wrote in message
news:cb990p$1t8b$1 digitaldaemon.com...
 Actually you need to use lib.exe to make a static library (link.exe
 won't do that for you). Maybe lib.exe is able to make use of larger
 command lines (haven't tried, though).

The command line length limit for lib is what the Win32 command prompt shell limit is (which varies depending on the version of Windows). But, each time one runs lib one can add to the library, so any long command can be broken up into multiple invocations of lib. Lib can also take a response file that has no arbitrary limit.
Jun 22 2004
prev sibling next sibling parent Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
Arcane Jill wrote:
 In article <cb8vnl$1fec$2 digitaldaemon.com>, Walter says...
 
2) Put the .obj files into a library, and link in the library.

Well, of course, I can't do that, can I? I can't make a library because I can't use the linker to make it WITH (because the command line is too long). So, I'm going to try option 1. Many thanks for that.

It depends on the type of library you are creating. On Linux, for example, .a libraries (which are used for dynamic linking purposes) are just archives of large numbers of object files. You don't actually link them until runtime. Another possibility is to create several smaller libraries, then link the libraries together. This makes a lot of sense if your program divides up into various different functional parts. I haven't tested it, but I would guess linking a few libraries together is probably faster than linking 100s of object files; thus, you might actually speed your build process this way. If you try it, give us all a holler and tell us how your speed is affected! Russ
Jun 22 2004
prev sibling parent "Walter" <newshound digitalmars.com> writes:
"Arcane Jill" <Arcane_member pathlink.com> wrote in message
news:cb957t$1nlt$1 digitaldaemon.com...
 In article <cb8vnl$1fec$2 digitaldaemon.com>, Walter says...
Two options:
1) Try using a linker response file, i.e. put the command in a file and


it with  filename.

Ok, thanks. I'll try that. I assume you mean to just put filename in the

 command line, instead of files to be linked, options, etc., and move the

 files to be linked, options, etc., into filename. That sounds quite

Yes. Also, you can break up a line in the response file into multiple lines.
2) Put the .obj files into a library, and link in the library.


 use the linker to make it WITH (because the command line is too long). So,

 going to try option 1. Many thanks for that.

The linker isn't used to create a library. Use lib: www.digitalmars.com/ctg/lib.html
Jun 22 2004
prev sibling parent reply Arcane Jill <Arcane_member pathlink.com> writes:
In article <cb8vnl$1fec$2 digitaldaemon.com>, Walter says...
1) Try using a linker response file, i.e. put the command in a file and link
it with  filename.

That worked 100%. Thanks a bunch. I am /so/ glad I have a custom build script. I was able to change its behavior in a very short space of time, to make it do exactly that. If I'd have been using make instead, I would have been stuck for days trying to get the makefile to get make to do that. Cheers. Jill
Jun 22 2004
parent Stephen Waits <steve waits.net> writes:
Arcane Jill wrote:
 I am /so/ glad I have a custom build script. I was able to change its behavior
 in a very short space of time, to make it do exactly that. If I'd have been
 using make instead, I would have been stuck for days trying to get the makefile
 to get make to do that.

It's trivial in SCons as well. --Steve
Jun 22 2004
prev sibling next sibling parent =?ISO-8859-1?Q?Sigbj=F8rn_Lund_Olsen?= <sigbjorn lundolsen.net> writes:
Arcane Jill wrote:

 I just got this error from the DMD linker: "The input line is too long".
 
 True, my command line is pretty long - currently it stands at 8482 characters -
 and is likely to get MUCH longer, as my current (Unicode) project progresses.
 
 This is a showstopper. What do I do? And is there any chance that the
hard-coded
 limit on the length of DMD's linker's command line could be lifted? Or at
least,
 increased to something practically unreachable like a megabyte?

640k ought to be enough for anyone. Moral: No limit is practically unreachable. Cheers, Sigbjørn Lund Olsen
Jun 22 2004
prev sibling parent Regan Heath <regan netwin.co.nz> writes:
On Tue, 22 Jun 2004 06:55:54 +0000 (UTC), Arcane Jill 
<Arcane_member pathlink.com> wrote:
 I just got this error from the DMD linker: "The input line is too long".

 True, my command line is pretty long - currently it stands at 8482 
 characters -
 and is likely to get MUCH longer, as my current (Unicode) project 
 progresses.

 This is a showstopper. What do I do? And is there any chance that the 
 hard-coded
 limit on the length of DMD's linker's command line could be lifted? Or 
 at least,
 increased to something practically unreachable like a megabyte?

My link command looks like this.. d:\D\dmd\bin\dmd.exe -g "$(IntDir)\*.obj" -of"$(OutDir)\$(WkspName).exe" Where $(IntDir) is replaced by the 'intermediate directory' which is where all my obj files get put when I build them. where $(OutDir) and $(WkspName) are replaced with the path and filename of the output executable. The downside to this method being if there are any obj files in the IntDir that I do not need they get linked anyway. But... As this is an VC++ utility project IntDir is actually d:\d\src\<project>\Debug regardless of where I pull the source files from i.e. d:\d\etc\crypto\hash\ d:\d\src\build\ etc So there aren't typically any excess obj files. Which of course means that I also have several copies of tiger.obj, one for each project that includes it, not optimal, but not a huge waste. Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 22 2004