From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2632 invoked by alias); 18 Dec 2001 17:39:38 -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 2606 invoked from network); 18 Dec 2001 17:39:37 -0000 Received: from unknown (HELO exil.ircam.fr) (129.102.1.2) by sources.redhat.com with SMTP; 18 Dec 2001 17:39:37 -0000 Received: from ircam.fr (kenong.ircam.fr [129.102.21.9]) by exil.ircam.fr (Postfix) with ESMTP id 5FA7D12F29; Tue, 18 Dec 2001 18:39:36 +0100 (CET) Message-ID: <3C1F7F58.E418E4A0@ircam.fr> Date: Mon, 10 Dec 2001 13:11:00 -0000 From: Tisserand Patrice X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en MIME-Version: 1.0 To: abrahamsmith@students.wisc.edu Cc: gsl-discuss@sources.redhat.com Subject: Re: gsl_complex_rect undefined? References: <20011218113006.A22589@euclid.dsl.wisc.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2001-q4/txt/msg00142.txt.bz2 Message-ID: <20011210131100.0ONmRvTmUtVx27W3hRMofEp2dMFK_Zy3IHC_1-9karg@z> 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 /* Humm: It's out of topic but it's better to use: #include instead of #include old version of include file and add: using namespace std; */ > > #include #include /* See comments lower */ > > 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? > According to the same page of the GSL Manual: The complex types are defined in the header file `gsl_complex.h', while the corresponding complex functions and arithmetic operations are defined in `gsl_complex_math.h'. I made the same mistake some time ago and I take some time to understand why it doesn't work. Thanks to be open source Patrice > > -- > # 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. #