June 22, 2004
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


June 22, 2004
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
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
>
>


June 22, 2004
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
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
>
>


June 22, 2004
"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.


June 22, 2004
"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
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?

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.


June 22, 2004
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


June 22, 2004
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
June 22, 2004
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
June 22, 2004
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

June 22, 2004
"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
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.

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

The linker isn't used to create a library. Use lib: www.digitalmars.com/ctg/lib.html


« First   ‹ Prev
1 2
Top | Discussion index | About this forum | D home