TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG-DEVEL:124] C++/C linking problems



"John J. Trammell" wrote:

> Hey.
>
> > I have waded through most of the issues but I am stumped on why
> > I get tons of "undefined reference to xxxx" - where xxx is generally
> > either some kind of global or library function in a C shared library
>

I recognize most of the symbols as various instantiations of some of my
template functions - and thus I know the pain is self inflicted.  It
appears some of my templates are being instantiated in my shared
libraries and some are not.  As a note this is code (templates) that do
compile on Digital Unix, HP-UX and Solaris - but we are using the
proprietary compilers on those platforms (and various platform
specific #ifdef, #pragma methodologies to go with each compiler).

I am flying by the seat of my pants on Linux here but from what I
read I am compiling my shared libraries with "-shared -frepo".
This looks like the "preferred" scheme with egcs-1.1.2 yes/no?

I thought I had gone through the code and made sure that everyplace
we had a template instantiation that the definition was there (the
template.C file was included by the already included template.h file).
I don't have to do anything to tell the linker to pick up all these *.rpo

files do I?

Something is still wrong.

I will toy with nm and should at  least gain some more insite into
the problem.

Thanks,

sjp

>
> Make up your mind -- was is "xxx" or "xxxx"?  :-)
>
> No, seriously.  Use the 'nm' utility to look through your
> libraries for the missing symbols.  Good luck.
>
> Maybe if you printed out some of your undefined references,
> we could suggest libraries that you need to link to.
>
> Regards,
> John
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-devel-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-devel-help@mn-linux.org