From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ba33,11af15607bd0af82 X-Google-Attributes: gid10ba33,public X-Google-Thread: fee84,77653ffe51c35a24 X-Google-Attributes: gidfee84,public From: dsr@lns598.lns.cornell.edu (Daniel S. Riley) Subject: Re: gcc 2.7.2, ld warnings on Digital UNIX v3.2 Date: 1996/05/01 Message-ID: #1/1 X-Deja-AN: 152397373 sender: dsr@lns100.lns.cornell.edu references: <4ktph9$o2n@odo.amherst.com> <4kubph$b90@vertex.tor.hookup.net> organization: Wilson Lab, Cornell U., Ithaca, NY 14853 newsgroups: comp.unix.osf.osf1,gnu.g++.help With <4lo9l0$n8g@disunms.epfl.ch>, it seems Radenko Kalajdzic (rkalajdz@di.epfl.ch) sez: rkalajdz> /usr/bin/ld: rkalajdz> Warning: clog defined as GLOBAL DATA but is defined in a shared rkalajdz> lib as a GLOBAL FUNC In article <4m6a4n$em2@valhalla.cs.wright.edu> pedwards@valhalla.cs.wright.edu (Phil Edwards) writes: pedwards> The problem is due to a conflict between iostream.h and pedwards> libm.a. The iostream header file contains this declaration: pedwards> extern _IO_ostream_withassign cout, cerr, clog; [...] pedwards> 3) Build a math library which doesn't contain clog(3), and pedwards> name it libm.a; keep the "real" one as liboldm.a or Won't fix it. The problem is with libm.so, not libm.a. If it were libm.a, the linker would just ignore the object module with clog in it, unless clog were actually called somewhere (in which case you have trouble anyway). It doesn't have that option with shared libraries, hence the message. To fix it, you either have to change the name of clog in libm.so, or fix g++ to link explicitly to libm.a instead of -lm. pedwards> 4) Find a version of g++ in which "g++" is just a script pedwards> which calls gcc with command-line arguments, and then pedwards> remove "-lm" from the script. Personally, I think GNU pedwards> made a /big/ mistake when they moved g++ to a separate pedwards> executable: their goal of "an integrated compiler" is pedwards> now further away, I don't understand this remark at all. g++ is just a front end that calls gcc with the appropriate arguments; whether it is a shell script or a C program makes no difference to how "integrated" the compiler is, as long as the C program has the same functionality as the shell script. The front-ends have very little to do with how "integrated" the compiler is anyway--everything interesting is in the back-ends. pedwards> and "gcc" doesn't correctly detect a C++ program pedwards> anymore. Works for me--the only thing gcc doesn't do is insert the C++ libraries and -lm on the link line. And it must work for you, if g++ works, since all g++ does is construct an appropriate invocation of gcc (just like the shell script did). Compile with 'g++ -v' if you don't believe me. -- Dan Riley Internet: dsr@lns598.lns.cornell.edu Wilson Lab, Cornell University HEPNET/SPAN: lns598::dsr (44630::dsr) http://w4.lns.cornell.edu/ "Distance means nothing/To me." -Kate Bush