[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Question
From: |
Gerold Jaeger |
Subject: |
Question |
Date: |
Fri, 11 Apr 2003 13:54:43 +0200 (MEST) |
My name is Gerold Jaeger from the university of Kiel in Germany.
I want to use the GNUmp package gmp-4.1.2 for arithmetic on
arbitrary precision numbers.
I have done as described in the file "INSTALL":
./configure
make
I have tested the following example program in this file
#include <stdio.h>
#include <gmp.h>
main (int argc, char **argv)
{
mpz_t a, b, p;
if (argc != 3)
{
printf ("Usage: %s <number> <number>\n", argv[0]);
return 1;
}
/* Initialize and assign a and b from base 10 strings in argv */
mpz_init_set_str (a, argv[1], 10);
mpz_init_set_str (b, argv[2], 10);
/* Initialize p */
mpz_init (p);
/* Multiply a and b and put the result in p */
mpz_mul (p, a, b);
/* Print p in decimal */
gmp_printf ("%Zd\n", p);
/* Since we're about to exit, no need to clear out variables */
return 0;
}
When I try to compile it with
"gcc -g -I. example.c .libs/libgmp.a"
I get the following:
"ld: warning: file .libs/libgmp.a(init.o): wrong ELF class: ELFCLASS64
Undefined first referenced
symbol in file
__gmpz_init_set_str /var/tmp/ccEt0tQb.o
__gmp_printf /var/tmp/ccEt0tQb.o
__gmpz_init /var/tmp/ccEt0tQb.o
__gmpz_mul /var/tmp/ccEt0tQb.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status"
My computer is of the follwowing type:
Machine hardware: sun4u
OS version: 5.8
Processor type: sparc
Hardware: SUNW,Ultra-Enterprise
Can you explain me what I have done wrongly?
Best regards,
Gerold Jaeger
- Question,
Gerold Jaeger <=