Thread View: comp.unix.programmer
2 messages
2 total messages
Started by Srikant K. T.
Fri, 14 Mar 1997 00:00
g++ problem on Linux
Author: Srikant K. T.
Date: Fri, 14 Mar 1997 00:00
Date: Fri, 14 Mar 1997 00:00
40 lines
1994 bytes
1994 bytes
I am using g++ on Caldera Linux (Redhat 4.0 based) system (kernel 2.0.25).
Was in the process of porting some software from Solaris to Linux, when I
hit a snag.
Here is an example of what is happening.
giskard:/u/srikant/misc 113 ] cat fl.c
#include <stdio.h>
#include <iostream.h>
int main()
{
long i = 3;
float f = i * 1000.0;
printf("f = %f\n", f);
cout << "f = " << f << endl;
cout << "500 = " << 500.0 << endl;
}
giskard:/u/srikant/misc 114 ] g++ -o fl fl.c
giskard:/u/srikant/misc 115 ] fl
f = 3000.000000
f = +1.69823e-4932
500 = -8.11449e-4237
giskard:/u/srikant/misc 116 ]
giskard:/u/srikant/misc 116 ] ldd fl
libg++.so.27 => /usr/lib/libg++.so.27.1.4
libstdc++.so.27 => /usr/lib/libstdc++.so.27.1.4
libm.so.5 => /lib/libm.so.5.0.8
libc.so.5 => /lib/libc.so.5.4.22
giskard:/u/srikant/misc 117 ]
Anybody has any idea why this is happening ? I have tested the same
piece of code on Solaris and Irix and they work just fine!
thanks in advance.
--
Srikant Tirumalai
ECE Department Email: srikant@u.arizona.edu
The University of Arizona, Tucson srikant@ece.arizona.edu
Re: g++ problem on Linux
Author: Dave Goldsmith
Date: Fri, 14 Mar 1997 00:00
Date: Fri, 14 Mar 1997 00:00
23 lines
1435 bytes
1435 bytes
Srikant K. T. wrote: > > I am using g++ on Caldera Linux (Redhat 4.0 based) system (kernel 2.0.25). I am using RedHat 4.0 based on a 2.0.18 kernel. > giskard:/u/srikant/misc 116 ] ldd fl > libg++.so.27 => /usr/lib/libg++.so.27.1.4 > libstdc++.so.27 => /usr/lib/libstdc++.so.27.1.4 > libm.so.5 => /lib/libm.so.5.0.8 > libc.so.5 => /lib/libc.so.5.4.22 My library versions are: libg++ 27.1.4 libstdc++ 27.1.4 libm 5.0.6 (this is different) libc 5.3.12 (this is different) It executes just fine on my box. Dave Goldsmith dgoldsmi@osec.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads