This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

linking of inline static methods



Greetings.

I'm new to GNU C++ and to Linux.  (I'm coming from IRIX).  This may
fall under the category of "Interoperation trouble" with the Linux
linker, rather than a strictly GNU C++ compiler bug; I'm not sure.

System:

   $ uname -a
   Linux vsl01 2.2.12-20 #1 Mon Sep 27 10:40:35 EDT 1999 i686 unknown

   $ g++ -v
   Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
   gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

Summary:

   Dynamically linked classes that declare inline static methods that
   access static class variables MUST be compiled with the pragmas:

      #pragma interface
      #pragma implementation

   Without the pragmas, it seems that the static class members are
   not properly linked.  The main program and the class library see
   different addresses for the same symbol.

I'm attaching "TestInlineStatic.tar.gz", which includes the source
and Makefile for a tiny program that demonstrates the problem.

--

Ted Hall
Department of Architecture
Chinese University of Hong Kong
Sha Tin, HONG KONG

Data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]