Kapil
25th May 2006, 05:52
Hi,
I am finding a strange problem... I have created a function with return type as map.. On one system it works pretty fine but when i transferred my app to another system for testing it was giving error... I couldnt find the reason for the error...
Here is the code :
map<int, vector<int> > getSB1Info(); // 89 Line - Error
map<int, vector<int> > getSB2Info(); // 90 Line - Error
map<int, vector<int> > getSB3Info(); // 91 Line - Error
inline map<int, vector<int> > CSwitchBlockSoln::getSB1Info() // 112 Line - Error
{
SSBConnectivity sbConn;
int fromTrack;
vector<int> toTrackList;
map< int, vector<int> > sb1Map;
vector<SSBConnectivity> eastSideList = m_pSB1Info->getEastSideList();
int eastSideListSize = eastSideList.size();
for(int fromTrackIndex = 0; fromTrackIndex < eastSideListSize; fromTrackIndex++)
{
sbConn = eastSideList[fromTrackIndex];
fromTrack = sbConn.getFromTrack();
sb1Map[fromTrack] = sbConn.getToTrackList();
}
return sb1Map;
}
inline map<int, vector<int> > CSwitchBlockSoln::getSB2Info() //132 Line - Error
{
SSBConnectivity sbConn;
int fromTrack;
vector<int> toTrackList;
map< int, vector<int> > sb2Map;
vector<SSBConnectivity> eastSideList = m_pSB3Info->getEastSideList();
int eastSideListSize = eastSideList.size();
for(int fromTrackIndex = 0; fromTrackIndex < eastSideListSize; fromTrackIndex++)
{
sbConn = eastSideList[fromTrackIndex];
fromTrack = sbConn.getFromTrack();
sb2Map[fromTrack] = sbConn.getToTrackList();
}
return sb2Map;
}
inline map<int, vector<int> > CSwitchBlockSoln::getSB3Info() //152 Line - Error
{
SSBConnectivity sbConn;
int fromTrack;
vector<int> toTrackList;
map< int, vector<int> > sb3Map;
vector<SSBConnectivity> eastSideList = m_pSB3Info->getEastSideList();
int eastSideListSize = eastSideList.size();
for(int fromTrackIndex = 0; fromTrackIndex < eastSideListSize; fromTrackIndex++)
{
sbConn = eastSideList[fromTrackIndex];
fromTrack = sbConn.getFromTrack();
sb3Map[fromTrack] = sbConn.getToTrackList();
}
return sb3Map;
}
And here are the errors:
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:89:
error: ISO C++ forbids declaration of `map' with no type
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:89:
error: expected `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:90:
error: ISO C++ forbids declaration of `map' with no type
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:90:
error: expected `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:91:
error: ISO C++ forbids declaration of `map' with no type
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:91:
error: expected `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:112
: error: expected init-declarator before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:112
: error: expected `,' or `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:132
: error: expected init-declarator before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:132
: error: expected `,' or `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:152
: error: expected init-declarator before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:152
: error: expected `,' or `;' before '<' token
Please tell me what can i do to fix up this problem...
Thank you,
with regards,
Kapil
I am finding a strange problem... I have created a function with return type as map.. On one system it works pretty fine but when i transferred my app to another system for testing it was giving error... I couldnt find the reason for the error...
Here is the code :
map<int, vector<int> > getSB1Info(); // 89 Line - Error
map<int, vector<int> > getSB2Info(); // 90 Line - Error
map<int, vector<int> > getSB3Info(); // 91 Line - Error
inline map<int, vector<int> > CSwitchBlockSoln::getSB1Info() // 112 Line - Error
{
SSBConnectivity sbConn;
int fromTrack;
vector<int> toTrackList;
map< int, vector<int> > sb1Map;
vector<SSBConnectivity> eastSideList = m_pSB1Info->getEastSideList();
int eastSideListSize = eastSideList.size();
for(int fromTrackIndex = 0; fromTrackIndex < eastSideListSize; fromTrackIndex++)
{
sbConn = eastSideList[fromTrackIndex];
fromTrack = sbConn.getFromTrack();
sb1Map[fromTrack] = sbConn.getToTrackList();
}
return sb1Map;
}
inline map<int, vector<int> > CSwitchBlockSoln::getSB2Info() //132 Line - Error
{
SSBConnectivity sbConn;
int fromTrack;
vector<int> toTrackList;
map< int, vector<int> > sb2Map;
vector<SSBConnectivity> eastSideList = m_pSB3Info->getEastSideList();
int eastSideListSize = eastSideList.size();
for(int fromTrackIndex = 0; fromTrackIndex < eastSideListSize; fromTrackIndex++)
{
sbConn = eastSideList[fromTrackIndex];
fromTrack = sbConn.getFromTrack();
sb2Map[fromTrack] = sbConn.getToTrackList();
}
return sb2Map;
}
inline map<int, vector<int> > CSwitchBlockSoln::getSB3Info() //152 Line - Error
{
SSBConnectivity sbConn;
int fromTrack;
vector<int> toTrackList;
map< int, vector<int> > sb3Map;
vector<SSBConnectivity> eastSideList = m_pSB3Info->getEastSideList();
int eastSideListSize = eastSideList.size();
for(int fromTrackIndex = 0; fromTrackIndex < eastSideListSize; fromTrackIndex++)
{
sbConn = eastSideList[fromTrackIndex];
fromTrack = sbConn.getFromTrack();
sb3Map[fromTrack] = sbConn.getToTrackList();
}
return sb3Map;
}
And here are the errors:
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:89:
error: ISO C++ forbids declaration of `map' with no type
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:89:
error: expected `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:90:
error: ISO C++ forbids declaration of `map' with no type
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:90:
error: expected `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:91:
error: ISO C++ forbids declaration of `map' with no type
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:91:
error: expected `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:112
: error: expected init-declarator before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:112
: error: expected `,' or `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:132
: error: expected init-declarator before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:132
: error: expected `,' or `;' before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:152
: error: expected init-declarator before '<' token
C:/backup/picoga_gui_view/PICOGA/Router/PiCoGA1.0/INCLUDE/CSwitchBlockSoln.h:152
: error: expected `,' or `;' before '<' token
Please tell me what can i do to fix up this problem...
Thank you,
with regards,
Kapil