Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!groucho!davis From: davis@groucho.ucar.edu (Glenn P. Davis) Newsgroups: comp.windows.x Subject: problem mixing compilers Keywords: gcc, sun3 Message-ID: <5896@ncar.ucar.edu> Date: 5 Jan 90 03:31:00 GMT Sender: news@ncar.ucar.edu Reply-To: davis@groucho.UCAR.EDU (Glenn P. Davis) Organization: Unidata/UCAR, Boulder CO Lines: 54 References: Environment: sun3, Sun OS 4.O.3, gcc version 1.36 #define HasGcc YES #define HasSunOSSharedLibraries YES When attempting to link simple Xaw programs using the sun cc complier, referencing system X libs built as above, there are unresovled externals which are not in gcc-gnulib. Linking with gcc is no problem. Repeat By: ===== simple make file, test.mk ==== INCLUDES = DEFINES = CPPFLAGS = $(INCLUDES) $(DEFINES) LOADLIBS = -lXaw -lXmu -lXt -lX11 xhw : xhw.o $(LINK.c) $(LINKOPTS) xhw.o $(LOADLIBS) -o $@ ==== end of test.mk === Script started on Thu Jan 4 20:01:55 1990 (groucho) 94 % pwd /u3/X11R4/mit/examples/Xaw (groucho) 95 % rm xhw ; make -f test.mk cc -sun3 xhw.o -lXaw -lXmu -lXt -lX11 -o xhw (groucho) 96 % xhw ld.so: call to undefined procedure __GetHostname from 0xebc073a (groucho) 97 % rm xhw ; make CC=gcc -f test.mk gcc -sun3 xhw.o -lXaw -lXmu -lXt -lX11 -o xhw (groucho) 98 % xhw # window apprears as it should (groucho) 99 % rm xhw ; make LINKOPTS=-Bstatic -f test.mk cc -sun3 -Bstatic xhw.o -lXaw -lXmu -lXt -lX11 -o xhw Undefined: _XrmDestroyDatabase __GetHostname *** Error code 1 make: Fatal error: Command failed for target `xhw' (groucho) 100 % exit script done on Thu Jan 4 20:05:42 1990 Note: adding the gnu library, gcc-gnulib, to the end of LOADLIBS, makes no difference. Glenn P. Davis UCAR / Unidata PO Box 3000 1685 38th St. Boulder, CO 80307-3000 Boulder, CO 80301 (303) 497 8643