delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/05/01:30:45

From: "0/0" <nsousbpoanmer AT naooslp DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: command line too short
Date: 5 Jun 1999 04:40:55 GMT
Organization: Value Net Internetwork Services Inc.
Lines: 55
Message-ID: <01beaf0d$690c4500$fc4484ce@sub>
References: <3 DOT 0 DOT 5 DOT 32 DOT 19990604133755 DOT 007ced70 AT jafar DOT uqar DOT uquebec DOT ca>
NNTP-Posting-Host: fgna-252.value.net
X-Newsreader: Microsoft Internet News 4.70.1162
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


Karel Uhlir <Karel_Uhlir AT UQAR DOT UQuebec DOT CA> wrote in article
<3 DOT 0 DOT 5 DOT 32 DOT 19990604133755 DOT 007ced70 AT jafar DOT uqar DOT uquebec DOT ca>...
> >
> >I'm assuming that my command line has gotten too long and the "-lalleg"
> >has been chopped down to "-la".  Anyone know how I can fix this? 
Thanks.
> >
> >Mark
> >
> >
> 
> I had a similar problem with the length of the command-line in a DOS
> window. This is what you mean isn't it? The DOS batch file seems to have
> the same limitations as the DOS command line.
> 
> I solved this by using the Rhide environment (see DJGPP web site for
> download) and creating a project with all the files I want compiled at
the
> same time to create the .exe file. You can add the compile options by
using
> the Options menu.
> 
> Hope this will help.
> 
> Karel
> 

Another good solution is to create library modules out of your code, and
then compile them with your main program.

Just convert your files to objects by doing this....

gcc -c file1.cpp file2.cpp

This will generate `file1.o' and `file2.o', and more if you specify more
files.
You can then use `ar' to create an library/archive file, like this...

ar rvs lib1.a file1.o file2.o

it generates a `lib1.a' file.
For convenence you can delete the object files after they are in the
library by simply using...

del *.o

And finaly to compile your main program code with the library you created,
you do this...

gcc main.cpp lib1.a -o test.exe

and that should do it.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019