bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sha.cpp compiler warnings


From: Prochnow, Christian
Subject: Re: sha.cpp compiler warnings
Date: Fri, 13 Dec 2002 10:12:04 +0100
User-agent: KMail/1.4.3

Am Freitag 13 Dezember 2002 01:04 schrieb Elizabeth Barham:
> The answer may be provided here:
>
snip
>
> Perhaps instead of:
>
> class CCXX_CLASS_EXPORT SHADigest<unsigned __int64,64>; // new
>
> if we were to try:
>
> extern template class CCXX_CLASS_EXPORT SHADigest<unsigned __int64,64>;


you should add CCXX_CLASS_EXPORT in front of the template class declaration:

template <class uint_type, unsigned blockSizeInBytes>
class CCXX_CLASS_EXPORT SHADigest {
         ^^^^^^^^^^^^^^^^^^^^^^^^

this works. tried it with VC 6 and VC.NET.
you don't need "extern template" declaration or something else.

Regards, 
Christian Prochnow

>
> (or just "template class..."), assuming of course that
> CCXX_CLASS_EXPORT expands to "__declspec(dllexport)", it may work.
>
> > Linking...
> > digesttest.obj : error LNK2001: unresolved external symbol "public:
> > virtual void __thiscall ost::SHADigest<unsigned
> > __int64,64>::putDigest(unsigned char const *,unsigned int)"
> > (address@hidden@_K$0EA@@ost@@address@hidden) Debug/digesttest.exe :
> > fatal error LNK1120: 1 unresolved externals Error executing link.exe.
>
> This is similar to gcc in that gcc requires an instantiation of a
> template if the template is defined in another file (or something like
> that).
>
> Anyway, perhaps by defining it as special with the "extern template"
> directive it may work.
>
> Thank you for all your help, btw.
>
> Elizabeth
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]