Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

gcc: Compile a simple program with "GNU Multiple Precision Arithmetic Library"

 
SOLVED
Go to solution
Highlighted
Visitor

gcc: Compile a simple program with "GNU Multiple Precision Arithmetic Library"

Hi,

Why doesn't gcc compile this simple program?

 

 

 

fraapp31_cotafac]/tmp# gcc -v kk.c
Using built-in specs.
Target: ia64-hp-hpux11.23
Configured with: ../gcc/configure
Thread model: posix
gcc version 4.2.3
 /usr/local/libexec/gcc/ia64-hp-hpux11.23/4.2.3/cc1 -quiet -v kk.c -quiet -dumpbase kk.c -auxbase kk -version -o /var/tmp//cc3XeKba.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/lib/gcc/ia64-hp-hpux11.23/4.2.3/../../../../ia64-hp-hpux11.23/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/lib/gcc/ia64-hp-hpux11.23/4.2.3/include
 /usr/include
End of search list.
GNU C version 4.2.3 (ia64-hp-hpux11.23)
        compiled by GNU C version 4.2.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: a60fba7fb6c876ab3d8a00a8d3192d93
 /usr/local/bin/as -x -o /var/tmp//ccqdO0Ue.o /var/tmp//cc3XeKba.s
 /usr/local/libexec/gcc/ia64-hp-hpux11.23/4.2.3/collect2 -z +Accept TypeMismatch -u main /usr/lib/hpux32/unix98.o -L/usr/local/lib/gcc/ia64-hp-hpux11.23/4.2.3 -L/usr/ccs/lib -L/usr/local/lib/gcc/ia64-hp-hpux11.23/4.2.3/../../.. /var/tmp//ccqdO0Ue.o -lgcc -lc -lgcc
ld: Unsatisfied symbol "__gmpz_init" in file /var/tmp//ccqdO0Ue.o
1 errors.
collect2: ld returned 1 exit status
[fraapp31_cotafac]/tmp#
[fraapp31_cotafac]/tmp#
[fraapp31_cotafac]/tmp# cat kk.c

#include <stdio.h>
#include <gmp.h>

int main()
{
        mpz_t x, y;
        mpz_init (x);

}
[fraapp31_cotafac]/tmp#
[fraapp31_cotafac]/tmp#
[fraapp31_cotafac]/tmp# ll /usr/local/lib/hpux64/libgmp.*
-rw-r--r--   1 root       sys        3339670 Aug 18  2017 /usr/local/lib/hpux64/libgmp.a
-rwxr-xr-x   1 root       sys            887 Aug 18  2017 /usr/local/lib/hpux64/libgmp.la
-r-xr-xr-x   1 root       sys        2079408 Aug 18  2017 /usr/local/lib/hpux64/libgmp.so
[fraapp31_cotafac]/tmp#
[fraapp31_cotafac]/tmp#
[fraapp31_cotafac]/tmp# uname -a
HP-UX fraapp31 B.11.23 U ia64 1849578169 unlimited-user license

 

 

 

 

I really appreciate any help you can provide.

Regards,

Jose Luis.

1 REPLY 1
Highlighted
Visitor
Solution

Re: gcc: Compile a simple program with "GNU Multiple Precision Arithmetic Library"

I had finaly compile with this command:

cc -I/usr/local/include +DD64 -L/usr/local/lib/hpux64 -lgmp +DD64 kk.c

 

Regards,

Jose Luis.