problem with using gnu mp on ubuntu 7.04

my system has:
- ubuntu 7.04
- code::blocks IDE w/ gcc compiler
- gmp-4.2.2.tar.gz which is downloaded here >> http://gmplib.org/#DOWNLOAD

I installed ubuntu (and has been using this for just a week) for the sake of using the library on a Linux-based system after seeing all the necessary files are built to be used on Linux-based systems (correct me if I'm wrong).

I followed the instructions on this page > http://gmplib.org/manual/Installing-GMP.html#Installing-GMP < on the Konsole and no errors were found.

The header (gmp.h) is then installed in /usr/local/include/gmp.h.

I then assumed that the library was installed successfully, but after I compiled the code below, an error had occurred (error msg is below the code).

1
2
3
4
5
6
7
8
9
10
11
#include <gmp.h>
#include <iostream>

using namespace std;

int main()
{
    mpz_t gmpInt;
    mpz_init(gmpInt); //This is line 9.
    return 0;
}


ERROR:
- line 9 -- undefined reference to '__gmpz_init'


I re-ran the installation commands on the manual but the error has not been fixed.

Is it a problem with these commands (not updated files for 'make' or something else)?

./configure
make

// I ran make check before make install and the output tells me that
// it had passed all tests.
make install

What does the error mean? Was the library miscompiled? If so, why was it miscompiled and what are the proper procedures?

A helpful reply would be VERY much appreciated because I am stuck with this problem for about 4 days now.
Last edited on
Please don't post the same question to multiple forums.
Topic archived. No new replies allowed.