Strange error

N

Neil

struct __alloca
{
unsigned int nsize;
int nline;
char szFile[250];
char **messages;
int trace_size ;
#ifdef OS_WINDOWS
unsigned long m_size;
_CRT_ALLOC_HOOK m_poldhook;
HMODULE m_dbghelp;
HANDLE m_process;
HANDLE m_thread; // Pseudo-handle meaning "current
thread" - required for obtaining stack traces
DWORD m_tlsindex; // Index for thread-local storage
of VLD data
STACKFRAME64 m_frame;
#endif

};

typedef map<void*,__alloca> MEMALLOCMAP;
typedef MEMALLOCMAP::iterator ITEM;


I get the error
error C2143: syntax error : missing ';' before '<'
error C2143: syntax error : missing ';' before '<'
error C2653: 'MEMALLOCMAP' : is not a class or namespace name

Please help me out fast
TAI
~Neil
 
R

Rolf Magnus

Neil said:
struct __alloca
{
unsigned int nsize;
int nline;
char szFile[250];
char **messages;
int trace_size ;
#ifdef OS_WINDOWS
unsigned long m_size;
_CRT_ALLOC_HOOK m_poldhook;
HMODULE m_dbghelp;
HANDLE m_process;
HANDLE m_thread; // Pseudo-handle meaning "current
thread" - required for obtaining stack traces
DWORD m_tlsindex; // Index for thread-local storage
of VLD data
STACKFRAME64 m_frame;
#endif

};

typedef map<void*,__alloca> MEMALLOCMAP;
typedef MEMALLOCMAP::iterator ITEM;


I get the error
error C2143: syntax error : missing ';' before '<'
error C2143: syntax error : missing ';' before '<'
error C2653: 'MEMALLOCMAP' : is not a class or namespace name

My guess would be that the compiler doesn't find a definition for 'map'.
Another guess would be that you mean the standard type std::map. Did you do
an '#include <map>' and a 'using std::map;'?
 
?

=?iso-8859-1?q?Erik_Wikstr=F6m?=

struct __alloca
{
unsigned int nsize;
int nline;
char szFile[250];
char **messages;
int trace_size ;
#ifdef OS_WINDOWS
unsigned long m_size;
_CRT_ALLOC_HOOK m_poldhook;
HMODULE m_dbghelp;
HANDLE m_process;
HANDLE m_thread; // Pseudo-handle meaning "current
thread" - required for obtaining stack traces
DWORD m_tlsindex; // Index for thread-local storage
of VLD data
STACKFRAME64 m_frame;
#endif

};

typedef map<void*,__alloca> MEMALLOCMAP;
typedef MEMALLOCMAP::iterator ITEM;

I get the error
error C2143: syntax error : missing ';' before '<'
error C2143: syntax error : missing ';' before '<'
error C2653: 'MEMALLOCMAP' : is not a class or namespace name

Please help me out fast

Since you didn't provide the lines on which the errors occurred I can
only guess, but perhaps you have not included <map> or you need to
prefix map<...> with std::.
 
F

Fei Liu

Neil said:
struct __alloca
{
unsigned int nsize;
int nline;
char szFile[250];
char **messages;
int trace_size ;
#ifdef OS_WINDOWS
unsigned long m_size;
_CRT_ALLOC_HOOK m_poldhook;
HMODULE m_dbghelp;
HANDLE m_process;
HANDLE m_thread; // Pseudo-handle meaning "current
thread" - required for obtaining stack traces
DWORD m_tlsindex; // Index for thread-local storage
of VLD data
STACKFRAME64 m_frame;
#endif

};

typedef map<void*,__alloca> MEMALLOCMAP;
typedef MEMALLOCMAP::iterator ITEM;


I get the error
error C2143: syntax error : missing ';' before '<'
error C2143: syntax error : missing ';' before '<'
error C2653: 'MEMALLOCMAP' : is not a class or namespace name

Please help me out fast
TAI
~Neil
MEMALLOCMAP is not a class or namespace name, clear enough. It's a
variable name. The correct typedef syntax is:
typedef typename std::map<void *, __alloca>::iterator ITEM;
 
Z

Zeppe

Fei said:
Neil said:
struct __alloca
{
unsigned int nsize;
int nline;
char szFile[250];
char **messages;
int trace_size ;
#ifdef OS_WINDOWS
unsigned long m_size;
_CRT_ALLOC_HOOK m_poldhook;
HMODULE m_dbghelp;
HANDLE m_process;
HANDLE m_thread; // Pseudo-handle meaning "current
thread" - required for obtaining stack traces
DWORD m_tlsindex; // Index for thread-local storage
of VLD data
STACKFRAME64 m_frame;
#endif

};

typedef map<void*,__alloca> MEMALLOCMAP;
typedef MEMALLOCMAP::iterator ITEM;


I get the error
error C2143: syntax error : missing ';' before '<'
error C2143: syntax error : missing ';' before '<'
error C2653: 'MEMALLOCMAP' : is not a class or namespace name

Please help me out fast
TAI
~Neil
MEMALLOCMAP is not a class or namespace name, clear enough. It's a
variable name. The correct typedef syntax is:
typedef typename std::map<void *, __alloca>::iterator ITEM;

it's not a class because of the previous errors.

Regards,

Zeppe
 
R

red floyd

Neil said:
struct __alloca
{
[body redacted for clarity

};

typedef map<void*,__alloca> MEMALLOCMAP;
typedef MEMALLOCMAP::iterator ITEM;


I get the error
error C2143: syntax error : missing ';' before '<'
error C2143: syntax error : missing ';' before '<'
error C2653: 'MEMALLOCMAP' : is not a class or namespace name

In addition to the other errors pointed out, the name __alloca is not
available for your use. Identifiers containing a double underscore are
reserved to the implementation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top