From: Andreas Unterkircher <unterkir@ivp.bepr.ethz.ch>
To: Tobias Ernst <tobi@bland.fido.de>
Subject: Re: CXX compiler problem
Date: Thu, 1 Nov 2001 14:47:06 +0100 [thread overview]
Message-ID: <Pine.SGI.4.40.0111011441110.7631-100000@trane.ethz.ch> (raw)
In-Reply-To: <1004614139@f1.n7600.z242.fido.de>
I'm not sure whether this is the source of your problem but I remember
that I once also had problems with cxx's template instantiaton. I wanted
to link a library to my C++ program and I also got messages similar to
your messages. The problem was that the library and the program did not
use the same cxx_repository directory. Are you sure that you always use
the same cxx_repository ? You can control it with the -ptr flag.
HTH,
Andreas
> 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 !?
[..]
next prev parent reply other threads:[~2001-11-01 13:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-01 10:20 CXX compiler problem Tobias Ernst
2001-11-01 13:47 ` Andreas Unterkircher [this message]
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