Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: tobi@bland.fido.de (Tobias Ernst)
Subject: CXX compiler problem
Date: Thu, 01 Nov 2001 11:20:38 MEZ	[thread overview]
Message-ID: <1004614139@f1.n7600.z242.fido.de> (raw)

Hallo All!

I have a problem with the template instantiation code in CXX on this 
platform:

tobi@caracal(524):~/appt/pore> uname -a; cxx -V; cc -V
OSF1 caracal.ica1.uni-stuttgart.de V5.0 910 alpha
Compaq C++ V6.3-014 for Digital UNIX V5.0 (Rev. 910)
Compiler Driver V6.3-014 (cxx) cxx Driver
Compaq C V6.4-214 (dtk) on Digital UNIX V5.0 (Rev. 910)
Compiler Driver V6.4-014 (dtk) cc Driver

The error I get when linking my application is this:

Unresolved:
GrayHist<PTC_ParaIArray<3, signed char>, 3>::porosity(void)
GrayHist<PTC_ParaIArray<3, signed char>, 3>::alt_specsurf(void)

Now the problem is that the class PTC_ParaIArray is defined as

template <class T, int NDIM>
class PTC_ParaIArray:public PTC_ParaIArray_Base<T,NDIM>
{...};

So you see that the type parameter T must be first and the integer 
parameter NDIM must be last. The file that provides alt_specsurf and 
porosity contains the correct symbols (verified with nm):

GrayHist<PTC_ParaIArray<signed char, 3>, 3>::alt_specsurf(void) 
GrayHist<PTC_ParaIArray<signed char, 3>, 3>::porosity(void)

However, for some mysterious reason, the object file where I call these 
functions mysteriously contains requests for 

GrayHist<PTC_ParaIArray<3, signed char>, 3>::alt_specsurf(void)
GrayHist<PTC_ParaIArray<3, signed char>, 3>::porosity(void)

i.E. the integer parameter 3 before the type parameter signed char.

The cxx files that produce those two object files include the SAME .h 
file with the definitions of PTC_ParaIArray. So why on earth does cxx 
resort the template parameters in the one object file, but not in the 
other !?

The code compiles flawlessly with gcc 2.95.2 and with KAI KCC. The code 
does not work with Compaq CXX 6.3-014 and CXX 6.3-012.

If anybody is interested, I can compile a more formal testcase.

Viele Gr��e,
Tobias



             reply	other threads:[~2001-11-01 10:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-01 10:20 Tobias Ernst [this message]
2001-11-01 13:47 ` CXX compiler problem Andreas Unterkircher
2001-11-02 13:45   ` Kenneth Block
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox