开发者

How I compile MPC code?

开发者 https://www.devze.com 2023-03-27 06:09 出处:网络
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开发者_运维百科 comm

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号