when I am trying to compile the below code I am getting error as below,
Could you please let me know how to solve the above compilation error for the below program snippet
=============== =============== =============== ===
Adapter.cpp:114 : error: âStringâ was not declared in this scope
Adapter.cpp:114 : error: expected `;' before âsessionâ
Adapter.cpp:115 : error: âsessionâ was not declared in this scope
Adapter.cpp:115 : error: variable-sized object âpSessionâ may not be initialized
=============== =============== ===============
Adapter.cpp:114 : error: âStringâ was not declared in this scope
Adapter.cpp:114 : error: expected `;' before âsessionâ
Adapter.cpp:115 : error: âsessionâ was not declared in this scope
Adapter.cpp:115 : error: variable-sized object âpSessionâ may not be initialized
=============== =============== ===============
Code:
MList<MRvDispatcher *> *m_pDispatchers;
m_pDispatchers = new MList<MRvDispatcher *>();
MRvSession *pSession = MRvSession::downCast(getComponentByName("RV"));
if (pSession)
{
int threads = atoi(lau.getEnv("X_Y_ENQ_THREADS").c_str());
for(int i=0; i<=threads;i++)
{
String session="RV"+i;
MRvSession *pSession[i] = MRvSession::downCast(getComponentByName(session));
MRvDispatcher *pDispatcher = new MRvDispatcher(this, pSession[i]);
m_pDispatchers->push_back(pDispatcher);
Comment