linking problems


jos
01-22-2003, 09:54 AM
Hi,

just installed NR in C without any problems. But when I tried to compile a little test program the linker had problems finding the NR functions.

e.g.:
> gcc -g -o runstest -L/usr/local/lib -I/usr/local/include -lrecipes_c -lm runstest.c

/home/jos/runstest.c:46: undefined reference to `qromb'
collect2: ld returned 1 exit status
>

When I link the required object file explicitly, however, it works:
>gcc -g -o runstest /usr/local/nr/recipes_c-ansi/recipes/qromb.o /usr/local/nr/recipes_c-ansi/recipes/trapzd.o /usr/local/nr/recipes_c-ansi/recipes/polint.o /usr/local/nr/recipes_c-ansi/recipes/nrutil.o -lm runstest.c
>

The second options is a pain, though, and I'd prefer the first one. Any ideas what's wrong?

jos

PS: In the NR Makefile I specified /usr/local/lib as my
LIPPATH and librecipes_c.a was copied there and contains all the objects.