sahl04
asked on
Which #include(s) are necessary for CMap
Dear all,
i encounter the following problem.
As specified in the documentation for CMap, i do include the following:
Using
everything works as expected, but if i specify the number of elements for the constructor like
i receive three times a compilation error.
error C2059: syntax error : 'constant'
It seems to me, that some other #include is missing.
Any ideas?
Best regards
sahl04
i encounter the following problem.
As specified in the documentation for CMap, i do include the following:
#include "afxtempl.h"
Using
CMap<CString*, CString*, int, int> map;
everything works as expected, but if i specify the number of elements for the constructor like
CMap<CString*, CString*, int, int> map(16);
i receive three times a compilation error.
error C2059: syntax error : 'constant'
It seems to me, that some other #include is missing.
Any ideas?
Best regards
sahl04
ps. the following line compiles without error message here.
CMap<CString*, CString*, int, int> map(16);
CMap<CString*, CString*, int, int> map(16);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, I forgot to delete the 'Error C2059' comment in the second sample ... just ignore it.
Error Message syntax error : 'token'
The token caused a syntax error.
To determine the cause, examine not only the line listed in the error message, but also the lines above it. The following example generates an error message for the line declaring j, but the true source of the error appears on the line just above it.
If examining the lines yields no clue to what the problem might be, try commenting out the line listed in the error message and possibly several lines above it.
If the error message occurs on a symbol immediately following a typedef variable, check that the variable is defined in the source code.
You may get C2059 if a symbol evaluates to nothing, as can occur when you compile with /Dsymbol=.