Ilya Khayutin <[EMAIL PROTECTED]> writes:

> Multipile Precision library). The GMP library on my
> SuSe 6.3 system is at /usr/lib/libgmp.a and the header
> file for it is at /usr/include/gmp.h . I have a
> Makefile for compiling it but the real command for
> compiling some files is:

You mean, linking...

>  g++ -g -O -o -lgmp *.C 

Disclaimers: I am guessing what you have in your makefile,
and I don't know much about g++/libgmp, but I see several
possible problems with your command. The particular problem
that you are asking about seems to be that 

a) -lgmp should follow *.C
b) I am not 100% sure that this is what happens, but it is likely
   that the loader thinks that -lgmp is the executable you are
   trying to create (because of the -o option), and does not
   link libgmp at all.

There are other things related to make that I'll skip here

The linkage rule should probably be sth like (assuming GNU make)

prog: $(OBJS)
        $(CXX) -o $@ $^ -lgmp

where $(OBJS) will be all your *.o files (you can through in -g and -O
if you feel like it). A version closer to yours, but less clean
(IMHO), will look like

        g++ -o prog -g -O *.C -lgmp

If you think I can be of further help, or if it is not entirely clear
why I suggest linking objects separately from compiling sources,
you are welcome to contact me off the list.

-- 
Oleg Goldshmidt | BLOOMBERG L.P. (BFM) | [EMAIL PROTECTED]
"... We work by wit, and not by witchcraft;
 And wit depends on dilatory time." - W. Shakespeare.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to