4

I am trying to use the MPC library from www.multiprecision.org. I want to compile the C++ code with g++ under Linux, with GMP and MPFR both installed. The point is I don't know what compiler flags I should use.

Paul Wintz
  • 2,542
  • 1
  • 19
  • 33

1 Answers1

2

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;
}
Michał Šrajer
  • 30,364
  • 7
  • 62
  • 85