This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Inverse Matrix Implementation Problem...
- From: Edmund Green <edmund at greenius dot co dot uk>
- To: W L A Au <eem1wa at eim dot surrey dot ac dot uk>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 04 Jul 2002 15:08:15 +0100
- Subject: Re: Inverse Matrix Implementation Problem...
- References: <1128.131.227.74.155.1025652431.squirrel@ike.ee.surrey.ac.uk>
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.