Find the answer to your Linux question:
Results 1 to 2 of 2
G++ guru: I got a large g++ program and I am not able to compile it. The error message is: /home/zyin/idps/PRO/include/ProCmnAlgorithm.h:1196: error: expected `;' before ‘mIter’ See the code below. ...
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    1

    Help g++ compiling, Please

    G++ guru:

    I got a large g++ program and I am not able to compile it. The error message is:

    /home/zyin/idps/PRO/include/ProCmnAlgorithm.h:1196: error: expected `;' before ‘mIter’

    See the code below. I don't understand. Could any guru give me a hand? Thanks.


    Benjamin
    Code:
    1187 template <class T, class U>
    1188 Int32 ProCmnAlgorithm::assignDataPtr(const string& str,
    1189                                      const map<string, U*>& m,
    1190                                      T& ptr,
    1191                                      Int32 idx)
    1192 {
    1193     ostringstream  oss;  // error string stream
    1194     string sErr("assignDataPtr() -- ");
    1195 
    1196     map<string, U*>::const_iterator mIter;
    1197 
    1198     mIter = m.find(str);
    1199     if (mIter == m.end())
    1200     {
    1201         oss << sErr << "m.find() failed.  str: " << str;
    1202         DEBUG_HIGH((*myLogger_), oss.str());
    1203         return PRO_FAIL;
    1204     }
    1205     if (mIter->second == 0)
    1206     {
    1207         // TODO: set error message
    1208         oss << sErr << "mIter->second == 0.  str: " << str;
    1209         DEBUG_HIGH((*myLogger_), oss.str());
    1210         return PRO_FAIL;
    1211     }
    1212 
    1213     ptr = static_cast<T> (mIter->second->getDataPtr(idx));
    1214 
    1215     if ((ptr == DM_BADADDRESS) && !(mIter->second->getDataItemShellStatus()))
    1216     {
    1217         // if the data item was optional, return success
    1218         if (mIter->second->getAltDataUsed() == ((Int8) -1))
    1219         {
    1220             // ptr == DM_BADADDRESS because of ProCmnDataItem::getDataPtr()'s
    1221             // implementation
    1222             return PRO_SUCCESS;
    1223         }
    1224 
    1225         oss << sErr << "mIter->second->getDataPtr() == DM_BADADDRESS.  str: " << str;
    1226         DEBUG_HIGH((*myLogger_), oss.str());
    1227         return PRO_FAIL;
    1228     }
    1229 
    1230     return PRO_SUCCESS;
    1231 }
    Last edited by devils casper; 03-27-2008 at 06:14 PM. Reason: Removed email id and added [code]....[/code] tag.

  2. #2
    Just Joined!
    Join Date
    Dec 2007
    Location
    Algeria
    Posts
    26
    i think u should declare mIter alone in another way.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...