Inverse Matrix Implementation Problem...
Edmund Green
edmund@greenius.co.uk
Thu Jul 4 07:08:00 GMT 2002
re:
> Please help me. I've encounter some problems when I try to implement the
> inverse matrix function by using the Gauss-Jordan Elimination routine,
> which is provided by the Numerical Recipes in C, Chapter 2.1
...
> However, when I use the gcc compiler command:
> gcc test2.c -o test2
>
> I've got the following error message:
>
> Undefined first referenced
> symbol in file
> free_ivector /var/tmp/cc4v8fRq.o
> ivector /var/tmp/cc4v8fRq.o
> nrerror /var/tmp/cc4v8fRq.o
> ld: fatal: Symbol referencing errors. No output written to test2
> collect2: ld returned 1 exit status
These missing library routines are found in the nrutil.c file (see
Appendix B of the book), to save having to duplicate them for each
example in the book.
This makes your compilation more complex, you should really be using
makefiles for anything with more than 1 source file (see "info make").
They are a very powerful but can also get very complicated.
However in this simple case, if you don't mind 'make' doing a few things
behind your back with its built in implicit rules, create a file called
"makefile" with the following single line in it
test2 : test2.o nrutil.o
and put in in a directory that also contains "test2.c", "nrutil.h" and
"nrutil.c", then run the command "make".
Edmund.
More information about the Gcc-help
mailing list