Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Nov 2002 23:20:57 -0500
From:      The Anarcat <anarcat@anarcat.ath.cx>
To:        Jordan K Hubbard <jkh@queasyweasel.com>
Cc:        libh@FreeBSD.ORG, Alexander Langer <alex@big.endian.de>
Subject:   Re: serious libh linking problems
Message-ID:  <20021113042057.GC9054@lenny.anarcat.ath.cx>
In-Reply-To: <69CC05B0-F6BD-11D6-9957-000393BB9222@queasyweasel.com>
References:  <20021113040224.GB9054@lenny.anarcat.ath.cx> <69CC05B0-F6BD-11D6-9957-000393BB9222@queasyweasel.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--ctP54qlpMx3WjD+/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Wow! Quick response! Yay! I'm very happy that you're there to help Jordan.

That's an interesting proposition. -l declaration order can have such
an effect? Let's see:

g++31  -O -pipe  -I../../include -I/usr/local/include/tcl8.3     -L/usr/loc=
al/lib -L/usr/lib -o pkg_create pkg_create.o -ltcl83 -lh -lhsysinstall -lht=
cl -lhdatabase -lhfile =20
/usr/lib/libhsysinstall.so: undefined reference to `LanguageInterface::Lang=
uageInterface(bool)'

g++31  -O -pipe  -I../../include -I/usr/local/include/tcl8.3     -L/usr/loc=
al/lib -L/usr/lib -o pkg_create pkg_create.o -ltcl83 -lhsysinstall -lh -lht=
cl -lhdatabase -lhfile=20
/usr/lib/libhsysinstall.so: undefined reference to `LanguageInterface::Lang=
uageInterface(bool)'

 g++31  -O -pipe  -I../../include -I/usr/local/include/tcl8.3     -L/usr/lo=
cal/lib -L/usr/lib -o pkg_create pkg_create.o -ltcl83 -lhtcl -lh -lhsysinst=
all  -lhdatabase -lhfile =20
/usr/lib/libhsysinstall.so: undefined reference to `LanguageInterface::Lang=
uageInterface(bool)'

g++31  -O -pipe  -I../../include -I/usr/local/include/tcl8.3     -L/usr/loc=
al/lib -L/usr/lib -o pkg_create pkg_create.o -ltcl83 -lhtcl -lhsysinstall -=
lh  -lhdatabase -lhfile=20
/usr/lib/libhsysinstall.so: undefined reference to `LanguageInterface::Lang=
uageInterface(bool)'

I got tired of trying about then. :) Note that I tried that
before. I've been struggling with such problems in libh for a while
now. Note that tclh links properly. The tclh commandline is:

gcc31 -pipe -g -I/usr/local/include/tcl8.3 -fpic -DPIC -I/usr/home/anarcat/=
cvs-work/libh/bin/tclh/../../include   -Wall  -static -o tclh.static tclh.o=
 -L/usr/home/anarcat/cvs-work/libh/compile/none -lhtcl -lh -lhtclfile -lhfi=
le  -lhtcldisk -lhdisk -lhtclhui -lhui  -lhtclsysinstall -lhsysinstall  -lh=
database  -ltcl83 -lm -L/usr/local/lib -lstdc++ -ldisk -lfetch -lz -lcom_er=
r -lssl -lcrypto -lm

But tclh is statically linked. I've never been able to dynamically
link tclh. linking fails miserably again, but it's interesting to note
that it fails similarly:

anarcat@lenny[~/libh/compile/none]% gcc31 -pipe -g -I/usr/local/include/tcl=
8.3 -fpic -DPIC -I/usr/home/anarcat/cvs-work/libh/bin/tclh/../../include   =
-Wall  -o tclh tclh.o -L/usr/home/anarcat/cvs-work/libh/compile/none -lhtcl=
 -lh -lhtclfile -lhfile  -lhtcldisk -lhdisk -lhtclhui -lhui  -lhtclsysinsta=
ll -lhsysinstall  -lhdatabase  -ltcl83 -lm -L/usr/local/lib -lstdc++ -ldisk=
 -lfetch -lz -lcom_err -lssl -lcrypto -lm
/usr/home/anarcat/cvs-work/libh/compile/none/libhsysinstall.so: undefined r=
eference to `cerr'
/usr/home/anarcat/cvs-work/libh/compile/none/libhsysinstall.so: undefined r=
eference to `LanguageInterface::LanguageInterface(bool)'

This is because "-L/usr/lib" is missing (???). Adding it gives us the
exact same result as trying to link pkg_create:

anarcat@lenny[~/libh/compile/none]% gcc31 -pipe -g -I/usr/local/include/tcl=
8.3 -fpic -DPIC -I/usr/home/anarcat/cvs-work/libh/bin/tclh/../../include   =
-Wall  -o tclh tclh.o -L/usr/home/anarcat/cvs-work/libh/compile/none -lhtcl=
 -lh -lhtclfile -lhfile  -lhtcldisk -lhdisk -lhtclhui -lhui  -lhtclsysinsta=
ll -lhsysinstall  -lhdatabase  -ltcl83 -lm -L/usr/local/lib -lstdc++ -ldisk=
 -lfetch -lz -lcom_err -lssl -lcrypto -lm -L/usr/lib
/usr/home/anarcat/cvs-work/libh/compile/none/libhsysinstall.so: undefined r=
eference to `LanguageInterface::LanguageInterface(bool)'
[...]

However, trying to link pkg_create statically doesn't give any better
results and actually spews thousands of undefined references.

Do you know which gcc wizard I could redirect this too?

A.

On Tue Nov 12, 2002 at 08:07:23PM -0800, Jordan K Hubbard wrote:
> Link order?  What happens when you stick -lhsysinstall *earlier* in the=
=20
> link line, say before -lhtcl?
>=20
> On Tuesday, November 12, 2002, at 08:02 PM, The Anarcat wrote:
>=20
> >Hi all
> >
> >I write this to you in an attempt to solve a recurring problem I'm
> >having with libh that is *really* hindering development, for me.  I'm
> >currently trying to rewrite our pkg_create sh script in C++ (from a sh
> >script). I just checked-in the source in libh/bin/pkg_create. You
> >haven't seen the mail because of DNS problems on rtp1.
> >
> >Anyways, I'm having problem linking the final program. I've seen
> >similar problems when trying to switch to rhtvision and link other
> >programs against libh.
> >
> >The source file is being properly compiled, g++ can find its headers,
> >etc, and I can generate the .o file. However, when trying to link, I
> >get:
> >
> >g++31  -O -pipe  -I../../include -I/usr/local/include/tcl8.3    -c=20
> >pkg_create.cc
> >g++31  -O -pipe  -I../../include -I/usr/local/include/tcl8.3    =20
> >-L/usr/local/lib -L/usr/lib -o pkg_create pkg_create.o -ltcl83 -lh=20
> >-lhtcl -lhdatabase -lhfile -lhsysinstall
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::LanguageInterface(bool)'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::Object type_info node'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::languageUnref(LanguageInterface::Object const &)=20
> >const'
> >/usr/lib/libhsysinstall.so: undefined reference to `LanguageInterface=20
> >type_info function'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::referenced(LanguageInterface::Object const *)=20
> >const'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::languageRef(LanguageInterface::Object const &)=20
> >const'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::referenced(LanguageInterface::Object const &)=20
> >const'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::Object type_info function'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::gc(void) const'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::referencedObjects(void)'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::referenceObject(LanguageInterface::Object const *)=
=20
> >const'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`Shared::onHeap(void const *)'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::dereferenceObject(LanguageInterface::Object const=20
> >*) const'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::object2string(LanguageInterface::Object const *)'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`Shared::isOnHeap(Shared const *)'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::~LanguageInterface(void)'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::languageRef(LanguageInterface::Object const *)=20
> >const'
> >/usr/lib/libhsysinstall.so: undefined reference to=20
> >`LanguageInterface::languageUnref(LanguageInterface::Object const *)=20
> >const'
> >/usr/lib/libhsysinstall.so: undefined reference to `LanguageInterface=20
> >type_info node'
> >collect2: ld returned 1 exit status
> >*** Error code 1
> >
> >Stop in /usr/home/anarcat/cvs-work/libh/bin/pkg_create.
> >
> >I have just installed that library (libhsysinstall). What I don't
> >understand is that I can't find that damn symbol anywhere:
> >
> >anarcat@lenny[~/libh/compile/none]% for f in libh*
> >do; nm -C $f 2>/dev/null | grep LanguageInterface::Language  && echo=20
> >"$f"
> >done
> >         U LanguageInterface::LanguageInterface(bool)
> >libhsysinstall.a
> >         U LanguageInterface::LanguageInterface(bool)
> >libhsysinstall.so
> >         U LanguageInterface::LanguageInterface(bool)
> >libhsysinstall.so.0
> >00000000 W LanguageInterface::LanguageInterface(bool)
> >libhtcl.a
> >000519da W LanguageInterface::LanguageInterface(bool)
> >libhtcl.so
> >000519da W LanguageInterface::LanguageInterface(bool)
> >libhtcl.so.0
> >00000000 W LanguageInterface::LanguageInterface(bool)
> >libhtcldisk.a
> >00043798 W LanguageInterface::LanguageInterface(bool)
> >libhtcldisk.so
> >00043798 W LanguageInterface::LanguageInterface(bool)
> >libhtcldisk.so.0
> >00000000 W LanguageInterface::LanguageInterface(bool)
> >libhtclfile.a
> >00049a12 W LanguageInterface::LanguageInterface(bool)
> >libhtclfile.so
> >00049a12 W LanguageInterface::LanguageInterface(bool)
> >libhtclfile.so.0
> >00000000 W LanguageInterface::LanguageInterface(bool)
> >libhtclhui.a
> >0007969e W LanguageInterface::LanguageInterface(bool)
> >libhtclhui.so
> >0007969e W LanguageInterface::LanguageInterface(bool)
> >libhtclhui.so.0
> >00000000 W LanguageInterface::LanguageInterface(bool)
> >libhtclsysinstall.a
> >000a4e32 W LanguageInterface::LanguageInterface(bool)
> >libhtclsysinstall.so
> >000a4e32 W LanguageInterface::LanguageInterface(bool)
> >libhtclsysinstall.so.0
> >
> >Some symbols are defined, however. For example, Shared::onHeap() is
> >defined in libh.so:
> >
> >0003a746 T Shared::onHeap(void const*)
> >libh.so
> >
> >The thing itself is kinda very important to libh. It is defined in
> >libh/include/LanguageInterface.hh:
> >
> >class LanguageInterface
> >{
> >     friend class H;
> >     friend class HObjectsReferences;
> >
> >  public:
> >     LanguageInterface( bool enableGC ) : mGC( enableGC ) {}
> >...
> >}
> >
> >Why it's not linking anywhere is beyond me.
> >
> >Also, why tclh is linking at all is also a great mystery for me.
> >
> >Please, any hint will help greatly. I'm completly confused and pretty
> >desperate to solve this problem.
> >
> >If I can't get this program to link I don't see very well where we
> >should be going next. Is it really impossible/forbidden to link
> >against LibH?
> >
> >A.
> >
> >--=20
> >Advertisers, not governments, are the primary censors of media content
> >in the United States today.
> >                        - C. Edwin Baker
> >                        http://www.ad-mad.co.uk/quotes/freespeech.htm
> ><mime-attachment>
> --
> Jordan K. Hubbard
> Engineering Manager, BSD technology group
> Apple Computer
>=20


--=20
Why bother building more nukes until we use the ones we already have?

--ctP54qlpMx3WjD+/
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE90dMottcWHAnWiGcRAuRtAJ91ER80iw4xzCCPSSCzw1sYfgZVawCfcWZg
cN8w4+rWyPuk/f/PbACFObw=
=ZoQN
-----END PGP SIGNATURE-----

--ctP54qlpMx3WjD+/--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-libh" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021113042057.GC9054>