|
From: Heiko G. <hg...@te...> - 2002-11-25 14:47:11
|
This is a general problem on windows with command shells, independend from the compiler you use. With the msvc you would use reponse files to pass object files to the linker. With gcc you could do a similar thing by using a linker script to supply the object files. See documentation of ld at http://sources.redhat.com/binutils/docs-2.12/ld.info/Scripts.html#Script s especially the GROUP and INPUT commands are of interest for your purpose. See "Simple commands"->"File Commands". for example: ------------------------------------ INPUT(objectfile1.o, objectfile2.o ....) GROUP(library1.a, library2.a, .....) ----------------------------------- The linker script with the object files (and/or libs) is than passed to the linker just like you did with the *.o and/or *.a files before. Greetings Heiko > -----Original Message----- > From: min...@li... > [mailto:min...@li...] On Behalf Of > Jamie Peterson > Sent: Monday, November 25, 2002 1:37 PM > To: min...@li... > Subject: [Mingw-users] Make (link) fails: Command line too long? > > > Hi All > > I've run into a problem lately that I'm hoping has an easy solution. > > I'm using Make 3.79.1 for Mingw32. I've compiled+linked > plenty of stuff with it no problems, but my project has > gradually grown larger and now all of a sudden linking > doesn't work any more. > > The problem seems to be that the command line used when > invoking the linker becomes too long to handle: > > I run make, it compiles the object files individually using > g++.exe, and then tries to start up g++.exe for linking, but fails: > "Command or filename not found". > > After a bit of testing I've discovered that either the > command line is too long, or there are too many arguments. > For example, by deleting the (redundant) include options from > the linking command, the linking worked again. Then, I kept > adding repeat copies of an option (-ldinput for example) > until suddenly the call to the linker failed again. > > Can anyone suggest how I might solve/work around this? I > hope I am doing something obvious wrong, or there is an easy > fix. There are only 20-30 object files to be linked, not a > huge number. > > Cheers > Richard > > > _____________________________________________________________ > Get your own FREE e-mail account at http://www.volcanomail.com > > _____________________________________________________________ > Select your own custom email address for FREE! Get > yo...@yo... w/No Ads, 6MB, POP & more! > http://www.everyone.net/selectmail?> campaign=tag > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |