[CM] s7, undefined reference errors

James Hearon j_hearon at hotmail.com
Mon Sep 19 10:57:37 PDT 2016


Hi,

I was trying to get back to looking at s7 as interpreter but I'm failing to compile for some reason.


I have s7.o, s7.h, and snd is working ok.  But I'm getting undefined ref errors trying to compile below and a little stumped what might be going wrong?  Seems like it's not finding something it needs.


//gcc -o repel_test repel_test.c s7.o  -Wl,-export-dynamic -lm -I. -ldl
#include "/opt/snd-16/s7.h"
int main (int argc, char **argv)
{
    s7_scheme *sc;
    sc = s7_init();
    s7_load(sc, "/opt/snd-16/repl.scm");
    s7_eval_c_string(sc, "((*repl* 'run))");
    return(0);
}

-----------------

/opt/snd-16/s7.o: In function `sweep':
s7.c:(.text+0x1b40): undefined reference to `__gmpz_clear'
s7.c:(.text+0x1bdf): undefined reference to `__gmpq_clear'
s7.c:(.text+0x1c7e): undefined reference to `mpfr_clear'
s7.c:(.text+0x1d1d): undefined reference to `mpc_clear'
/opt/snd-16/s7.o: In function `s7_number_to_real_with_caller':
s7.c:(.text+0x1e272): undefined reference to `mpfr_get_d'
/opt/snd-16/s7.o: In function `s7_real':
s7.c:(.text+0x1e470): undefined reference to `mpfr_get_d'
/opt/snd-16/s7.o: In function `s7_is_negative':
s7.c:(.text+0x1e956): undefined reference to `mpfr_sgn'
/opt/snd-16/s7.o: In function `s7_is_positive':
s7.c:(.text+0x1ea20): undefined reference to `mpfr_sgn'
/opt/snd-16/s7.o: In function `s7_real_part':
...
/opt/snd-16/s7.o: In function `s7_random':
s7.c:(.text+0x12e539): undefined reference to `mpfr_get_d'
/opt/snd-16/s7.o: In function `s7_gmp_init':
s7.c:(.text+0x12f864): undefined reference to `mpfr_set_default_prec'
/opt/snd-16/s7.o: In function `s7_init':
s7.c:(.text+0x13efa2): undefined reference to `__gmpz_init_set_ui'
s7.c:(.text+0x13efb5): undefined reference to `__gmp_randinit_default'
s7.c:(.text+0x13efd2): undefined reference to `__gmp_randseed'
s7.c:(.text+0x13efe1): undefined reference to `__gmpz_clear'
collect2: error: ld returned 1 exit status


Regards,
Jim


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20160919/c23ba399/attachment.html>


More information about the Cmdist mailing list