How 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 both installed. The point is i don't know what flags i should put in开发者_运维百科 command line for compiling.
you need to link with libmpc:
gcc foo.c -o foo -lmpc
I test it with mpc from ubuntu packages:
sudo aptitude install libmpc-dev libmpc2
my foo.c looks like:
#include "mpc.h"
int main() {
mpc_t x;
mpc_init2 (x, 256);
return 0;
}
精彩评论