Thread View: gnu.g++.bug
1 messages
1 total messages
Started by zhao
Thu, 04 May 1989 00:13
Possible Misplacement of math library in ld++
Author: zhao
Date: Thu, 04 May 1989 00:13
Date: Thu, 04 May 1989 00:13
45 lines
1898 bytes
1898 bytes
This short program shows a possible misplacement of math library when
ld++ tries to load it. Swapping "-lg++" and "-lm" eliminates the
problem.
This is run in a SUN3/60M OS4.0.1 using the normal ld.c (not newld.c)
Script started on Wed May 3 17:04:19 1989
[1]: cat bug1.c
#include <stream.h>
#include <Complex.h>
main (void) {
Complex a(2, 4), b(3, 5);
Complex c = a + b;
cout << a << " + " << b << " = " << c << "\n";
}
[2]: g++ -g -v -c bug1.c
g++ version 1.35.0-
/home/wiener/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 bug1.c /tmp/cca04788.cpp
GNU CPP version 1.35
/home/wiener/local/lib/gcc-c++ /tmp/cca04788.cpp -quiet -dumpbase bug1.c -noreg -version -G -o /tmp/cca04788.s
GNU C++ version 1.35.0- (68k, MIT syntax) compiled by GNU C version 1.34.91.
as -mc68020 /tmp/cca04788.s -o bug1.o
[3]: g++ -v -o bug1 bug1.o -lm
g++ version 1.35.0-
/home/wiener/local/lib/gcc-ld++ -o bug1 -C -dc -dp /home/wiener/local/lib/gcc-crt0+.o /lib/Mcrt1.o bug1.o -lm -lg++ /home/wiener/local/lib/gcc-gnulib -lc
Undefined symbols:
_log
_sqrt
_atan2
_sinh
_sin
_cos
_cosh
_exp
_hypot
[4]: /home/wiener/local/lib/gcc-ld++ -o bug1 -C -dc -dp /home/wiener/local/lib/gcc-crt0+.o /lib/Mcrt1.o bug1.o -lg++ -lm /home/wiener/local/lib/gcc-gnulib -lc
[5]: bug1
(2, 4) + (3, 5) = (5, 9)
[6]: exit
[7]:
script done on Wed May 3 17:06:04 1989
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