Re: errors -C2059 and C2143
Hi Karim,
I wonder if you are not falling prey to the new feature where VS 2005
converts your build to Unicode when you convert old projects. In this case
you have a normal comment string (for example). There errors don't lead me
to that conclusion, but it happens a lot and you did mention just converting
the project to VS 2005 so ...
Also, you could just use #pragma once in the header file to keep it from
being multiply included.
One more thing. Unless you really need ___VALUETABLE_H__ to have a value of
1 you can simply define it.
#define ___VALUETABLE_H_1
Tom
"karim" <karim@discussions.microsoft.com> wrote in message
news:C937524E-2403-4EE4-BB58-1B48ACDB3B4B@microsoft.com...
Hi All,
The code was compiled sucessfully with vc++6.0 but the same code in
vc++8.0
is giving 100 of syntax error, which are listed at the last. the error is
pointing in the below file.
**********Valuetable.h*****************
#ifndef ___VALUETABLE_H__
#define ___VALUETABLE_H__ 1
#pragma comment(exestr, "xyz_WOSA/XFS$RCSfile: include/ValueTable.h
$$Revision: 1.5 $$Name: AptSim_030000_UTR_01_DEP AptSim_030000_UTR_01_IDC
AptSim_93000012 AptSim_93000015 SIMPIN_BETA2 $$Date: 2003/11/24
20:55:51IST
$WOSA/XFS_xyz")
#include <map>
#include <string>
static enum
Value{BASE,ALIGNMENT,ORIENTATION,SIDE,TYPE,SCALING,BARCODE,CLASS,ACCESS,OVERFLOW,STYLE,CASE,COLOR,HORIZONTAL,VERTICAL,FILLCOLOR,
FILLSTYLE, FOLD, SOURCE};
using namespace std;
typedef map<string, short> ValueMap;
typedef map<short, ValueMap > KeywordValueMap;
class ValueTable
{
public:
bool AddValue(short, string&, int);
int LookupValue(short key, string& value_name);
private:
ValueMap values;
KeywordValueMap key_values;
};
#endif
---------------------------------------error-list------------------------------------------------
Error 7 error C2143: syntax error : missing '}' before 'constant'
c:\testsandbox\simptr\include\ValueTable.h 1
Error 9 error C2059: syntax error : 'constant'
c:\testsandbox\simptr\include\ValueTable.h 1
Error 41 error C2065: 'STYLE' : undeclared identifier
c:\TestSandBox\SimPTR\source\XFSPrinterFrameParser.cpp 124
---------and many of this kind.........................................
i have checked the source code file that #includes valuetable.h and also
checked the header file gets included just before valuetable.h. There is
no
syntax missing like ; or }
Can any one help me on this error.
-karimulla.