[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GMP and DJGPP
From: |
Chris Johnstone |
Subject: |
GMP and DJGPP |
Date: |
Tue, 19 Mar 2002 12:47:47 -0800 (PST) |
Hey fellow GMPers,
I'm using the DJGPP build of GMP 4.01.
I'm trying to get this program to compile with gpp:
compile line: gcc -o main.exe test.c -lgmp
-----
program: test.c
#include <gmpxx.h>
#include <iostream>
using namespace std;
int
main (void)
{
mpz_class a, b, c;
a = 1234;
b = "-5678";
c = a+b;
cout << "sum is " << c << "\n";
cout << "absolute value is " << abs(c) << "\n";
return 0;
}
--
result:
c:/djgpp/tmp\ccMJ9X6m.o(.gnu.linkonce.t._ZlsI16__gmp_unary_exprI10__gmp_exprI12__gmpz_valueS2_E18__gmp_abs_functionEERSoS6_RKS1_IS2_T_E+0x30):test.c:
undefined reference to `operator<<(std::ostream&,
__mpz_struct const*)'
c:/djgpp/tmp\ccMJ9X6m.o(.gnu.linkonce.t._ZlsRSoRK10__gmp_exprI12__gmpz_valueS1_E+0x1c):test.c:
undefined reference to `operator<<(std::ostream&,
__mpz_struct const*)'
Does the C++ half of GMP not work for DJGPP, or am I
missing something obvious?
Chris Johnstone
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
- GMP and DJGPP,
Chris Johnstone <=