Mail Archives: djgpp/1999/06/05/01:30:45
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 -