Article View: gnu.g++
Article #144G++ and Sunview under SunOS 4.0.*
From: Jim Knutson
Date: Tue, 26 Sep 1989 19:18
Date: Tue, 26 Sep 1989 19:18
55 lines
2009 bytes
2009 bytes
Description:
There is a problem with using sunview code and any loader which
doesn't know how to deal with shared libraries in SunOS 4.0.*.
In particular, g++, the Gnu C++ compiler.
The sunwindow static libraries, /usr/lib/sunwindow.a and
/usr/lib/libsunwindow_p.a, contain a reference to __DYNAMIC in
the pf.o module. Apparently, this is used to test for and
implement, shared fonts. Doing a static load using Sun's loader
works because it understands the __DYNAMIC symbol and takes care
of it.
Repeat-By:
Fix the sunview header files to work for g++.
Compile the following program
#include "sunview.h"
main()
{
Frame base;
base = window_create(0, FRAME, FRAME_LABEL, "hello world!", 0);
window_main_loop(base);
}
% g++ sunview.cc -lsuntool -lsunwindow -lpixrect
... warning messages ...
pf.o: Undefined symbol __DYNAMIC referenced from text
Fix:
I reported this to Sun, but they called it a feature, not a bug,
so I don't know if it will ever get fixed by Sun.
To detect which libraries have the problem use:
nm /usr/lib/lib*.a >/tmp/nm.all
and look for references to __DYNAMIC. Ideally, there should
be none.
There are two ways that I have found to fix the probem.
1. Use ar to remove pf.o from /usr/lib/libsunwindow*.a. This
is ok since there is another copy in libpixrect.a without
the __DYNAMIC reference.
2. Force the loading of the libpixrect copy of pf.o by changing
the library load order.
g++ sunview.cc -lsuntool -lpixrect -lsunwindow -lpixrect
Jim Knutson
knutson@mcc.com
cs.utexas.edu!milano!knutson
--
Jim Knutson
knutson@mcc.com
cs.utexas.edu!milano!knutson
Technical Details
Message-ID:
<2943@perseus.sw.mcc.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!milano!perseus!knutsonShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!milano!perseus!knutson From: knutson@perseus.sw.mcc.com (Jim Knutson) Newsgroups: gnu.g++ Subject: G++ and Sunview under SunOS 4.0.* Message-ID: <2943@perseus.sw.mcc.com> Date: 26 Sep 89 19:18:26 GMT Organization: MCC, Austin, TX Lines: 55