#pragma implementation and multiple files
Arun Sharma
asharma@netscape.com
Sun Dec 28 10:34:00 GMT 1997
>From the g++ man page:
>
> [ #pragma interface and #pragma implementation ]
>
> Backup copies of inline member functions, debugging information, and
> the internal tables used to implement virtual functions are all
> generated in implementation files.
>
> There is no way to split up the contents of a single header file into
> multiple implementation files.
And that's exactly what's happening in our project. Is this limitation
on having to implement all of a class in a single implementation file
by design or a temporary restriction ?
Incidentally, if I define -g and -O together, the inline functions
don't generate undefined references in the linking stage and all is
well. However debugging with -O is a bit unpleasant.
To re-iterate my problem:
1. I have virtual functions and inlined functions in the same class.
2. The class implementation is spread over multiple files.
3. Compiling with -g gives rise to linker errors, since the "backup
copies of inline member functions" are not put in *any* of the
object files.
4. With -g and -O there are no backup copies of inline member
functions, so all is well.
This happens even on the 12/25 snapshot. I can mail test programs
which demonstrate this problem, if someone is interested.
-Arun
More information about the Gcc
mailing list