From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3490 invoked by alias); 4 Jul 2002 14:08:54 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 3480 invoked from network); 4 Jul 2002 14:08:52 -0000 Received: from unknown (HELO localhost.localdomain) (217.37.211.98) by sources.redhat.com with SMTP; 4 Jul 2002 14:08:52 -0000 Received: from greenius.co.uk (edmund.greenius.internal [192.168.100.199]) by localhost.localdomain (8.11.6/8.11.6) with ESMTP id g64E8Fs29930; Thu, 4 Jul 2002 15:08:15 +0100 Message-ID: <3D2456CF.5000904@greenius.co.uk> Date: Thu, 04 Jul 2002 07:08:00 -0000 From: Edmund Green User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc1) Gecko/20020417 X-Accept-Language: en-us, en MIME-Version: 1.0 To: W L A Au CC: gcc-help@gcc.gnu.org Subject: Re: Inverse Matrix Implementation Problem... References: <1128.131.227.74.155.1025652431.squirrel@ike.ee.surrey.ac.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00041.txt.bz2 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.