*
:
> Could some C++ guru please help me? I am using a BigInteger class which
> is really
> a wrapper around a C source file(mpi.c) that does arbitrary precision
> arithmetic operations. When I compile the C file using gcc -g -o mpi
> mpi.c rng.c -lm
> there are NO compilation or linking errors. However, when I try to
> compile the
> C++ wrapper class using g++ -g -o bigint bigint.C mpi.c rng.c -lm, I
> get strange linkage problems that all the functions in the C
> file(mpi.c) are 're-defined'. I have checked over and over, but there
> is no re-definition of the functions. I have not posted the source
> code, as it is fairly huge. Could someone provide some
> ideas as to what might be going wrong? I am using gcc 3.2.3. Thanks in
> advance for your help!
You have probably #include'd [mpi.c], the function definitions, in
[bigint.C] or in a file #include'd by [bigint.C], instead of
#include'ing [mpi.h], just the function declarations.
In that case there are two resolution: (1) leave out [mpi.c] in the g++
command line (i.e. this is how you want it), or (2) change the #include.
Method (2) is the recommended one, because #include of definitions is
often very problematic.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?