gcc error: instantiated from...
Question posted by: vartas
(Newbie)
on
July 2nd, 2008 11:24 AM
Hi,
i got the following gcc-error and hope you could help me to unterstand why:
instantiated from 'const XWCPC* FILE_FM::LOCALE::fct_format(const xs_t*, xs_t*, FILE_FM::FB*, T, XWCP*) [with T = long double]'
-
template<class T>
-
const XWCPC *fct_format(XS_CS ft, xs_t *buf, FB *o, T v, XWCP *r)
-
{ o->getFt(&ft);
-
int l = LOCALE::xsPrintf1(buf, ft, v);
-
...
-
return r;
-
};
|
|
July 2nd, 2008 03:08 PM
# 2
|
Re: gcc error: instantiated from...
Beats me. Nort enough code to see what's going on.
I did take your code and make some asumptions and did not get any error:
-
typedef int XWCP;
-
typedef const int XWCPC;
-
typedef int XS_CS;
-
typedef int xs_t;
-
typedef int FB;
-
template<class T>
-
class LOCALE
-
{
-
public:
-
int xsPrintf1(xs_t* buf, XS_CS ft, T v);
-
};
-
template<class T>
-
int LOCALE<T>::xsPrintf1(xs_t* buf, XS_CS ft, T v)
-
{
-
return 0;
-
}
-
template<class T>
-
const XWCPC *fct_format(XS_CS ft, xs_t *buf, FB *o, T v, XWCP *r)
-
{ o->getFt(&ft);
-
int l = LOCALE::xsPrintf1(buf, ft, v);
-
...
-
return r;
-
};
-
-
int main()
-
{
-
-
LOCALE<long double> obj;
-
int a = 10;
-
int b = 20;
-
long double c = 3.5;
-
obj.xsPrintf1(&a,b,c);
-
}
|
|
July 3rd, 2008 08:15 AM
# 3
|
Re: gcc error: instantiated from...
Thank you, weaknessforcats. This has already helped to locate the fault, but I am still 'overextend' with it. Here the code for the method:
-
typedef wchar_t xs_ucs4_t;
-
typedef xs_ucs4_t xsu_t;
-
typedef xsu_t xs_t;
-
#define XS_(t) (t)
-
#define XS_CTC_(T) const T *const
-
#define XS_CUC XS_CTC_(xsu_t)
-
#define LOCALE_BUF_SIZE 255
-
-
template<class T>
-
static int xsPrintf1(xsu_t *b, XS_CUC f, T v)
-
{
-
char bf[LOCALE_BUF_SIZE];
-
char bv[LOCALE_BUF_SIZE];
-
-
const xs_t *x = XS_(f);
-
char *y = bf;
-
-
for (int i = LOCALE_BUF_SIZE-1; i >= 0; i--)
-
{
-
if (!(*y++ = (char)(*x++)))
-
break;
-
}
-
*y = 0;
-
-
int r = snprintf(bv, LOCALE_BUF_SIZE,bf, v);
-
-
y = bv;
-
-
while (*b++ = (unsigned char)(*y++));
-
-
return r;
-
}
thank you in advance for your help readiness.
|
|
July 3rd, 2008 09:53 AM
# 4
|
Re: gcc error: instantiated from...
Ok, thank you very much. Could it be a make-issue? In your code above, I received the following errors:
'template <class T> class LOCALE' used without template
parameters, line: int l = LOCALE: xsPrintf1 (buf, ft, v);
make: *** [main.o] .
Not the answer you were looking for? Post your question . . .
189,088 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).
|