How do I compile MPC code?

MPC is here: http://www.multiprecision.org/ I want to compile C ++ code with g ++ under Linux, with GMP and MPFR installed. The thing is, I donโ€™t know which flags should I put on the command line to compile.

+4
source share
1 answer

you need to link to libmpc:

gcc foo.c -o foo -lmpc 

I am testing it with mpc from ubuntu packages:

 sudo aptitude install libmpc-dev libmpc2 

my foo.c looks like this:

 #include "mpc.h" int main() { mpc_t x; mpc_init2 (x, 256); return 0; } 
+2
source

All Articles