Ewan Anderson
Ewan Anderson

Reputation: 29

Using GMP for C++ Ubuntu 12.04

I'm trying to use the GMP library on Ubuntu 12.04 for C++ and am having trouble. I installed it fine but can't get any of my programs to work with it and they say "undefined reference to '_gmpf_add' and all the other operations. I am using the Code::Blocks IDE.

Upvotes: 2

Views: 856

Answers (1)

vedantk
vedantk

Reputation: 386

Make sure that you're linking to gmp. That may be as simple as editing your makefile and adding "-lgmp" to your LDFLAGS.

Example:

$ g++ gmp-code.cc -lgmp -o gmp-code

Upvotes: 2

Related Questions