From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1512 invoked by alias); 18 Dec 2001 17:37:18 -0000 Mailing-List: contact gsl-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sources.redhat.com Received: (qmail 1490 invoked from network); 18 Dec 2001 17:37:12 -0000 Received: from unknown (HELO bio.vu.nl) (130.37.80.1) by sources.redhat.com with SMTP; 18 Dec 2001 17:37:12 -0000 Received: from monodon.bio.vu.nl (monodon [130.37.88.41]) by bio.vu.nl (8.9.3+Sun/8.9.3) with ESMTP id SAA18008; Tue, 18 Dec 2001 18:37:10 +0100 (MET) Received: from localhost (fleur@localhost) by monodon.bio.vu.nl (8.10.2+Sun/8.9.3) with ESMTP id fBIHb8p21257; Tue, 18 Dec 2001 18:37:08 +0100 (MET) X-Authentication-Warning: monodon.bio.vu.nl: fleur owned process doing -bs Date: Mon, 10 Dec 2001 12:37:00 -0000 From: Fleur Kelpin X-X-Sender: To: Abraham David Smith cc: Subject: Re: gsl_complex_rect undefined? In-Reply-To: <20011218113006.A22589@euclid.dsl.wisc.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2001-q4/txt/msg00141.txt.bz2 Message-ID: <20011210123700.Ld3RenrdiHx1tGoR3dpoLVJgeF_BKqt71vdDnBLxC1Y@z> Hi, You need the include file gsl_complex_math.h In case of similar trouble, grep the include files: (in the /usr/local/include or similar:) >cd gsl/complex >grep gsl_complex_rect *.h gsl_complex_math.h:gsl_complex gsl_complex_rect (double x, double y); /* r= real+i*imag */ gsl_complex_math.h:gsl_complex_rect (double x, double y) gsl_complex_math.h:#define GSL_COMPLEX_ONE (gsl_complex_rect(1.0,0.0)) gsl_complex_math.h:#define GSL_COMPLEX_ZERO (gsl_complex_rect(0.0,0.0)) gsl_complex_math.h:#define GSL_COMPLEX_NEGONE (gsl_complex_rect(-1.0,0.0)) Greetings, Fleur Kelpin On Tue, 18 Dec 2001, Abraham David Smith wrote: > > I am trying to use GSL 1.0 on an ix86 running an essentially normal RedHat > Linux 7.1 installation (with all of RedHat's published patches applied > to gcc, etc). > > Consider the following code snippet: > > #include > #include > void main() > { > gsl_complex a = gsl_complex_rect(1.0,2.0); > cout << GSL_REAL(a) << ", " << GSL_IMAG(a) << endl; > GSL_SET_COMPLEX (&a, 3.0, 4.0); > cout << GSL_REAL(a) << ", " << GSL_IMAG(a) << endl; > } > > Compiling this with g++ gives: > > testcomplex.cpp: In function `int main (...)': > testcomplex.cpp:9: `gsl_complex_rect' undeclared (first use this > function) > testcomplex.cpp:9: (Each undeclared identifier is reported only once > for each function it appears in.) > > > now consider the snippet: > > #include > #include > void main() > { > gsl_complex a; > cout << GSL_REAL(a) << ", " << GSL_IMAG(a) << endl; > GSL_SET_COMPLEX (&a, 3.0, 4.0); > cout << GSL_REAL(a) << ", " << GSL_IMAG(a) << endl; > } > > > this compiles and gives: > 2.10391, 7.02217 > 3, 4 > > > > According to page 18 of the GSL manual > [ http://sources.redhat.com/gsl/ref/gsl-ref_5.html#SEC34 ], the function > gsl_complex_rect should be defined. What's up here? > > > -- > # Abraham David Smith UW--Madison Mathematics/Physics Undergraduate [*] # > # Y!:abrahamdavidsmith AOL-IM:abrahamsmith # > # http://euclid.dsl.wisc.edu/~abe Molon Labe! Defend your rights! # > # [*]: The views I express are not necessarily those of the UW--Madison, etc. # >