This is the mail archive of the gcc-bugs@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]

template static members on BSD, HPUX in 2.95.1


Hi,

In trying to compile cgicc-3.1 on BSD and HP/UX, we've run into some
problems that I believe are related to static data members in template
classes.

On an i386-unknown-freebsd2.2.8 system running gcc-2.95.1, a simple test
program cannot be linked, while the same program works correctly with
gcc-2.95.1 on Solaris and Linux.  I know this sounds like a linker error
at first glance, but I don't believe so since the compiler is not
producing object code for the static member.

% g++ -v --save-temps testT.cpp 
Reading specs from
/usr/home/sbooth/lib/gcc-lib/i386-unknown-freebsd2.2.8/2.95.1/specs
gcc version 2.95.1 19990816 (release)
 /usr/home/sbooth/lib/gcc-lib/i386-unknown-freebsd2.2.8/2.95.1/cpp
-lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus
-Dunix -Di386 -D__FreeBSD__ -D__unix__ -D__i386__ -D__FreeBSD__ -D__unix
-D__i386 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)
-D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__
testT.cpp testT.ii
GNU CPP version 2.95.1 19990816 (release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:

/usr/home/sbooth/lib/gcc-lib/i386-unknown-freebsd2.2.8/2.95.1/../../../../include/g++-3
 /usr/local/include

/usr/home/sbooth/lib/gcc-lib/i386-unknown-freebsd2.2.8/2.95.1/../../../../i386-unknown-freebsd2.2.8/include
 /usr/home/sbooth/lib/gcc-lib/i386-unknown-freebsd2.2.8/2.95.1/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/home/sbooth/lib/gcc-lib/i386-unknown-freebsd2.2.8/2.95.1/cc1plus
testT.ii -quiet -dumpbase testT.cc -version -o testT.s
GNU C++ version 2.95.1 19990816 (release) (i386-unknown-freebsd2.2.8)
compiled by GNU C version 2.95.1 19990816 (release).
 as -o testT.o testT.s
 /usr/home/sbooth/lib/gcc-lib/i386-unknown-freebsd2.2.8/2.95.1/collect2 -e
start -dc -dp /usr/lib/crt0.o
-L/usr/home/sbooth/lib/gcc-lib/i386-unknown-freebsd2.2.8/2.95.1
-L/usr/home/sbooth/lib testT.o -lstdc++ -lm -lgcc -lc -lgcc
testT.o: Undefined symbol `C<int>::i' referenced from text segment
collect2: ld returned 1 exit status


I've attached testT.ii to this message, compressed with bzip2.

Thanks,

Stephen


testT.ii.bz2


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