delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/06/13:12:38

From: bd733 AT rgfn DOT epcc DOT edu (Jason M. Daniels)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Make Info files confusing..
Date: 6 Jun 1997 05:47:42 GMT
Organization: The Rio Grande Free-Net, El Paso Community College, El Paso, TX
Lines: 35
Message-ID: <5n889u$spf@news.epcc.edu>
References: <5n69kf$2fe$3 AT thor DOT atcon DOT com>
NNTP-Posting-Host: rgfn.epcc.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

SteelGolem (myork AT auracom DOT com) wrote:
> I can't understand how to make one (1) exe file out of many (multiple) c
> or cc files.. why does it have to be so complicated?? if ya can't show
> me that, at least show me how to make a library file (___.a),
> PLEASE!!?!?! (although both would be nice.. =P) 
> thanks for ANY help!!!  --email please!

Hey, I can show you both.

You need to make objects files from each .c or .cc file. Like so: (TAILOR 
this command line to your needs, it's generic)

gcc -Wall -c foo.c -o foo.o

Do that for each .c or .cc file you want to compile. To link them 
together into an .exe file:

gcc -Wall foo.o bar.o -o foobar.exe

To make a library:

ar cvs foo.o bar.o libfoo.a

(I'm NOT sure about that 'ar' command.)

You can look these things up in the infofiles:

info gcc invoking (for how to invoke gcc)
info binutils ar (for how to use ar)

--
Jason Daniels -- bd733 AT rgfn DOT epcc DOT edu
---> BELIEVE THE LIE <---
Linux: The choice of a GNU generation.
Winblows 95: The world's best-selling computer virus.

- Raw text -


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