Re: [CM] s7, undefined reference errors
As Kjetil points out, you must have configured Snd with --with-gmp or somehow created mus-config.h with WITH_GMP set to 1. That file does not come with s7 (on the theory that people will read the instructions). If you want to use gmp, you'll need -lgmp -lmpfr -lmpc. If not, just delete whatever is in mus-config.h and recompile s7, or run configure again (for Snd) without --with-gmp, make clean, make. ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist
Re: [CM] s7, undefined reference errors
On Mon, Sep 19, 2016 at 7:57 PM, James Hearon wrote: > 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' > Hi, It seems like you compile s7 with "WITH_GMP" defined somehow. Perhaps you have a mus-config.h file where WITH_GMP is defined? I guess it compiles if you remove WITH_GMP from mus-config.h, or link in libgmp: -lgmp ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist
[CM] s7, undefined reference errors
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 ___ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist