0
votes

error C2143: syntax error : missing ';' before '.'
error C4430: missing type specifier - int assumed. Note: C does not support default-int error C2371: 'TranslationMap' : redefinition; different basic types

static UString FindTranslatedString(UString propertyName);
static std::map<UString,UString> TranslationMap ;



static UString engString("TextAlignmentPosition");
static UString transString(MSGTXT("TextAlignmentPosition"));

TranslationMap.insert(std::pair<UString,UString>(transString,engString));

UString FindTranslatedString(UString propertyName)
{
    UString NotFound("CannotFind");
    std::map<UString, UString>::iterator itr;
    itr = TranslationMap.find(propertyName);
    if(itr!= TranslationMap.end())
    {
        return itr->second;
    }
    else
    {
        return NotFound;
    }
}
1
Statements go in functions.chris

1 Answers

0
votes

1) Are you using c compiler (gcc) or c++ compiler (g++)?

2) If it's your whole code, it's wrong to put TranslationMap.insert() global, you should put it into a function, e.g. main()

3) What's the definition of MSGTXT?