gcc error: instantiated from... | Newbie | | Join Date: Jul 2008
Posts: 3
| |
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;
-
};
| | Moderator | | Join Date: Mar 2007 Location: North Bend Washington USA
Posts: 5,366
| | | 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);
-
}
-
| | Newbie | | Join Date: Jul 2008
Posts: 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.
| | Newbie | | Join Date: Jul 2008
Posts: 3
| | | 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] .
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,295 network members.
|