This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: #pragma interface && generating virtual tables (of templates?)
- To: carlo at runaway dot xs4all dot nl
- Subject: Re: #pragma interface && generating virtual tables (of templates?)
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 20 Feb 1999 20:32:07 +0100
- CC: egcs at cygnus dot com
- References: <199902201741.SAA11876@jolan.ppro>
> /home/carlo/c++/egcs.bugs/bug3/ircd.lag.cc:34: undefined reference to `server_sock_dct virtual table'
[...]
> Am I correct to think that this would be a bug, because
> templates should not be influenced by '#pragma interface'
> at all (since they don't generate code by themselfs to
> begin with)?
I'd agree this is a bug, at least on the information you provided. Of
course, providing a full bug support (i.e. including preprocessor
output of ircd.lag.ii) shouldn't be that difficult, unless you've
copyright problems.
The virtual table for server_sock_dct should get emitted into
ircd.lag.o. As a work-around, you can probably force this by
implementing get_output_stream out-of-line.
> I understand this is all pretty vague :(, because I can't provide
> a working example - but perhaps someone can give me a clue on
> whether or not using #pragma interface is deprecated in this case
> and/or if I can organize things differently so I won't get undefined
> virtual tables all the time :)
I'd say #pragma interface is deprecated, period. If you count the
trouble you had with it, don't you agree that it wasn't worth it?
With the new weak and link-once symbols on Linux-ELF, there is hardly
any use for it anymore.
Regards,
Martin