[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Compiling a C++ program with gmpxx.h
From: |
emarti19 |
Subject: |
Compiling a C++ program with gmpxx.h |
Date: |
Fri, 26 Apr 2002 00:09:43 -0700 |
I was able to build GMP no problem on by i686, Mandrake 8.1 DE PC.
When I built the libraries, I used "./configure --enable-cxx". I ran both
"make" and "make install", no problem, and "make check" worked fine. When I
compile the program:
#include <iostream>
#include <gmpxx.h>
void main() { }
It runs with no problems, which means it can include the headers fine.
However, when I do the simpliest operation, it gives me an error. In the
program:
#include <iostream.h>
#include <gmpxx.h>
int main ()
{
mpz_class a;
return 0;
}
G++ (the compilier I am using) prints the following when I try it compile:
address@hidden programming]$ g++ test.cpp
/tmp/ccqhPZVJ.o: In function `__gmp_expr<__gmpz_value,
__gmpz_value>::__gmp_expr(void)':
/tmp/ccqhPZVJ.o(.__gmp_expr<__gmpz_value,
__gmpz_value>::gnu.linkonce.t.(void)+0xe): undefined reference to
`__gmpz_init'
/tmp/ccqhPZVJ.o: In function `__gmp_expr<__gmpz_value,
__gmpz_value>::~__gmp_expr(void)':
/tmp/ccqhPZVJ.o(.gnu.linkonce.t._._t10__gmp_expr2Z12__gmpz_valueZ12__gmpz_valu
e+0x11):
undefined reference to `__gmpz_clear'
collect2: ld returned 1 exit status
Do I need different arguments when I run "./configure"? What do you recommend?
- Edward Marti
- Compiling a C++ program with gmpxx.h,
emarti19 <=