T.R | Title | User | Personal Name | Date | Lines |
---|
449.1 | | MIPSBX::thomas | The Code Warrior | Wed Mar 22 1989 11:37 | 2 |
| What does your link line look like?
|
449.2 | vcc -o prg mod1.o mod2.o mod3.o mod4.o mod5.o -ldwt -lX11 -lm | LDP::WEAVER | Laboratory Data Products/Science | Wed Mar 22 1989 14:54 | 18 |
| vcc -o prg mod1.o mod2.o mod3.o mod4.o mod5.o -ldwt -lX11 -lm
I have also replaced the ".o"'s with ".c"'s to force recompilation.
The same behaviour occurs with either "vcc" or "cc" (pcc). I haven't
tried it on a PMAX yet.
I posted a slightly later note in the "X" conference and someone
said it is a known problem (I also received mail from someone saying
it is a known problem). Both people said there was a note discussing
the problem, but I have been unable to find it either here or in
the X conference.
If I remove the "-lX11" I then get all the X routines undefined
but I don't get the multiply defined _calloc, so I believe the problem
lies in Ultrix' libX11.a.
-Dave
|
449.3 | | MIPSBX::thomas | The Code Warrior | Wed Mar 22 1989 18:08 | 3 |
| Where are your references to calloc and cfree? You might want to change
them to XtCalloc and XtFree.
|
449.4 | That may be just the ticket (the Ultrix bug should still be fixed) | LDP::WEAVER | Laboratory Data Products/Science | Wed Mar 22 1989 18:31 | 10 |
| That sounds like a good possibility; in an ideal world one would
only use XtCalloc for X related allocations, and calloc for normal
C allocations (stuff not bound to DECwindows).
Looking at the docs I see there are equivalents for all the C *alloc
functions.
Thanks for the suggestion,
-Dave
|
449.5 | Ultrix QAR system anywhere? | LDP::WEAVER | Laboratory Data Products/Science | Wed Mar 22 1989 18:33 | 2 |
| Is there an Ultrix QAR system somewhere for internal use?
|
449.6 | node gorge | FUEL::graham | if ya want home cookin, stay home | Wed Mar 22 1989 19:51 | 7 |
| username::qar_internal
password:qar
Please check though...
Kris..
|
449.7 | bug in -lX11, possible workaround | HIT::GLASER | Steve Glaser DTN 237-2586 SHR1-3/E29 | Wed Mar 22 1989 20:23 | 35 |
| There was a note concerning this in the GNU conference.
GNU Emacs uses its own malloc and free but did not provide a calloc.
The standard c library calloc is perfectly happy to work on top
of any malloc. It doesn't require the one from libc.
The Ultrix X library provides a replacement malloc (in module
XvmsAlloc.o of /usr/lib/libX11.a). There are supposed to be some
performance imporvements in this malloc.
Problem is that the version in the X library has one object module
(XvmsAlloc.o) that contains four subroutines malloc, calloc, free and
realloc. This prevents you supplying your own malloc and using calloc
from the library. You will get multiply defined symbols like you
were seeing.
You might try
vcc ...mumble... -lc -ldwt -lX11 -lm
(e.g. include -lc twice, once early on and once at the end).
P.S. The calloc in libX11.a is also buggy, it doesn't check to see if
the call on malloc succeeded and blindly goes out attempting to zero a
buffer starting at location zero.
P.P.S. I have not submitted this as a QAR because (1) I have not
gotten any response on the QAR's I've submitted so far -- for all I
know they are disappearing into a black hole and (2) the qar databases
listed on node gorge are limited to field test software and I'm running
SDC Ultrix Workstation Software. [If you notice minor frustration,
you're right...]
|
449.8 | | PSW::WINALSKI | Paul S. Winalski | Wed Mar 22 1989 21:48 | 7 |
| .7 has it right. Try specifying -lc earlier on in the command line:
vcc -o prg mod1.o mod2.o mod3.o mod4.o mod5.o -lc -ldwt -lX11 -lm
^^^^
--PSW
|
449.9 | Xt*alloc seems to be working | LDP::WEAVER | Laboratory Data Products/Science | Thu Mar 23 1989 13:09 | 8 |
| I am now using XtMalloc, XtCalloc and XtFree rather than malloc,
calloc, free, cfree and it seems to be working OK and I no longer
get the the multiply defined _calloc. The problem still should
be fixed, if anyone can provide a definitive QAR file for Ultrix
I will QAR the problem.
-Dave
|