Mail Archives: djgpp/1995/07/22/14:08:13
Todd Muhlfelder (twm AT escape DOT com) writes:
> I heard that the only way to find out which libs correspond with which
> header files was to use a program called NM.EXE (?). I ran "NM LIBC.A"
> and it started scrolling down the screen. I could not read one line (too
> fast). Is there a way to do this by saving it to a file or any other
> argument on the command line? Please help :)
The FAQ lists which functions are in which headers and which libraries. In
summary:
For math functions, include MATH.H and link with -lm
For random numbers, include RANDOM.H
For PC specific functions and CONIO.H functions link with -lpc
For graphics functions include GRAPHICS.H and link with -lgr
For C++ classes loink with -lgpp
Note that thew order of the -l entries on the command line is important.
Use:
gcc yoursrc.c othersrc.c custmlib -lm -lgpp -lgr -lpc -o yourobj.cof
(Omit any -l's that you don't need)
As for reading the NM output, try
NM somelib.a >TEMP.TXT
then try
EDIT TEMP.TXT
--
.*. "Clouds are not spheres, mountains are not cones, coastlines are not
-() < circles, and bark is not smooth, nor does lightning travel in a
`*' straight line." ,------------------------------------------------
-- B. Mandelbrot | Paul Derbyshire (PGD) ao950 AT freenet DOT carleton DOT ca
- Raw text -