From: Bruce DOT L DOT Conroy AT jpl DOT nasa DOT gov (Bruce Conroy) Subject: b19 and complex numbers 15 Apr 1998 07:15:06 -0700 Message-ID: <3.0.32.19980414091349.007ab830.cygnus.gnu-win32@blackwidow.jpl.nasa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: gnu-win32 AT cygnus DOT com I'm having trouble linking c++ programs that use complex numbers under b19. I get errors involving multiple definitions of the complex operators. I have extracted a small program that links and runs fine under b18, but not b19. The program and error message are included at the end of the message. Is this a problem with my installation or with b19? If it is b19, is it a known bug? Thanks in advance Bruce Conroy Bruce DOT L DOT Conory AT jpl DOT nasa DOT gov The program -------------------------------------- #include #include typedef complex Complex; // cosine integral // computes integral from ll to ul of cos(a(x+b)) Complex cos_1(Complex a, double b, double ll, double ul) { Complex temp; if(a==0.0) temp=(ul-ll); else temp=1.0/a*(sin(a*(ul+b))-sin(a*(ll+b))); return temp; } int main (void) { Complex x(1.0, 0.0); double a=0.0, b=1.0, c=2.0; cout << cos_1(x, a, b, c) << endl; return 0; } --------------------------------------- The error --------------------------------------- C:\GNUWIN32\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(dcomplex.o): In function `complex _dv(complex const &, double)': /home/noer/src/97r2/devo/libstdc++/std/complext.h:237: multiple definition of `complex operator/(complex const &, double)' C:\WINDOWS\TEMP\cc0010121.o(.text$__dv__H1Zd_RCt7complex1ZX01X01_t7complex1ZX01+0x0):comtest.cc: first defined here C:\GNUWIN32\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(dcomplex.o): In function `complex _ml(complex const &, complex const &)': /home/noer/src/97r2/devo/libstdc++/std/complext.h:209: multiple definition of `complex operator*(complex const &, complex const &)' C:\WINDOWS\TEMP\cc0010121.o(.text$__ml__H1Zd_RCt7complex1ZX01T0_t7complex1ZX01+0x0):comtest.cc: first defined here C:\GNUWIN32\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(dcomplex.o): In function `complex _mi(complex const &, complex const &)': /home/noer/src/97r2/devo/libstdc++/std/complext.h:182: multiple definition of `complex operator-(complex const &, complex const &)' C:\WINDOWS\TEMP\cc0010121.o(.text$__mi__H1Zd_RCt7complex1ZX01T0_t7complex1ZX01+0x0):comtest.cc: first defined here C:\GNUWIN32\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(fcomplex.o): In function `complex _dv(complex const &, float)': /home/noer/src/97r2/devo/libstdc++/std/complext.h:237: multiple definition of `complex operator/(complex const &, float)' C:\WINDOWS\TEMP\cc0010121.o(.text$__dv__H1Zf_RCt7complex1ZX01X01_t7complex1ZX01+0x0):comtest.cc: first defined here C:\GNUWIN32\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(ldcomplex.o): In function `complex _dv(complex const &, long double)': /home/noer/src/97r2/devo/libstdc++/std/complext.h:237: multiple definition of `complex operator/(complex const &, long double)' C:\WINDOWS\TEMP\cc0010121.o(.text$__dv__H1Zr_RCt7complex1ZX01X01_t7complex1ZX01+0x0):comtest.cc: first defined here --------------------------------------- - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".