Hi folks my name is Terry, I have just joined. I still use good Visual studio 6.0 ... hate change me.
Looking for some hep with a compiler error (STL)!
Hi this is TerryIntro
Page 1 of 1
5 Replies - 779 Views - Last Post: 03 April 2006 - 12:52 PM
Replies To: Hi this is Terry
#2
Re: Hi this is Terry
Posted 29 March 2006 - 01:11 AM
#3
Re: Hi this is Terry
Posted 29 March 2006 - 05:00 AM
Welcome to dream in code! Glad to have you.
#4
Re: Hi this is Terry
Posted 29 March 2006 - 05:18 AM
Thanks folks!
I think I have solved my issue, it seems that the compiler gets in a twist with function name overloading in templates and appears confuse things like:
template < class V >
class OEL_EXPORT COELCombo : public COELComboBase
{
public:
COELCombo( );
virtual ~COELCombo();
....
bool Populate ( std::map < CString,V>* pMap);
bool Populate ( ADODB::_RecordsetPtr &rs, long ID=NULL); //************
bool Populate ( std::set < V>* pSet, long ID=NULL); //************
bool Populate( std::set < V*>* pSet, long ID=NULL);
bool Populate ( std::map < long,V>* pMap, long ID=NULL);
bool Populate ( std::map < long,V*>* pMap, long ID=NULL);
bool Populate ( std::vector< long, V*>* pV, long ID=NULL);
.....
};
The ones marked ******* seem to confuse the compiler in the vector STL header. I have got around it by renaming these two so that function overloading does not occur. But this seems a bit weird to me .. any ideas?
This is the compiler output if I name all the populate functions with the same name:
--------------------Configuration: CMS - Win32 Debug--------------------
Compiling...
System.cpp
d:\program files\microsoft visual studio\vc98\include\vector(23) : error C2039: 'size_type' : is not a member of '`global namespace''
D:\Data\Dev\CMS\2.0\2.0.0\2.0.0.3\Code\CMS\Src\System.cpp(456) : see reference to class template instantiation 'std::vector<long,class CSystem *>' being compiled
d:\program files\microsoft visual studio\vc98\include\vector(23) : error C2146: syntax error : missing ';' before identifier 'size_type'
D:\Data\Dev\CMS\2.0\2.0.0\2.0.0.3\Code\CMS\Src\System.cpp(456) : see reference to class template instantiation 'std::vector<long,class CSystem *>' being compiled
d:\program files\microsoft visual studio\vc98\include\vector(23) : error C2868: 'size_type' : illegal syntax for using-declaration; expected qualified-name
D:\Data\Dev\CMS\2.0\2.0.0\2.0.0.3\Code\CMS\Src\System.cpp(456) : see reference to class template instantiation 'std::vector<long,class CSystem *>' being compiled
d:\program files\microsoft visual studio\vc98\include\vector(24) : error C2039: 'difference_type' : is not a member of '`global namespace''
D:\Data\Dev\CMS\2.0\2.0.0\2.0.0.3\Code\CMS\Src\System.cpp(456) : see reference to class template instantiation 'std::vector<long,class CSystem *>' being compiled
etc
etc
etc
I think I have solved my issue, it seems that the compiler gets in a twist with function name overloading in templates and appears confuse things like:
template < class V >
class OEL_EXPORT COELCombo : public COELComboBase
{
public:
COELCombo( );
virtual ~COELCombo();
....
bool Populate ( std::map < CString,V>* pMap);
bool Populate ( ADODB::_RecordsetPtr &rs, long ID=NULL); //************
bool Populate ( std::set < V>* pSet, long ID=NULL); //************
bool Populate( std::set < V*>* pSet, long ID=NULL);
bool Populate ( std::map < long,V>* pMap, long ID=NULL);
bool Populate ( std::map < long,V*>* pMap, long ID=NULL);
bool Populate ( std::vector< long, V*>* pV, long ID=NULL);
.....
};
The ones marked ******* seem to confuse the compiler in the vector STL header. I have got around it by renaming these two so that function overloading does not occur. But this seems a bit weird to me .. any ideas?
This is the compiler output if I name all the populate functions with the same name:
--------------------Configuration: CMS - Win32 Debug--------------------
Compiling...
System.cpp
d:\program files\microsoft visual studio\vc98\include\vector(23) : error C2039: 'size_type' : is not a member of '`global namespace''
D:\Data\Dev\CMS\2.0\2.0.0\2.0.0.3\Code\CMS\Src\System.cpp(456) : see reference to class template instantiation 'std::vector<long,class CSystem *>' being compiled
d:\program files\microsoft visual studio\vc98\include\vector(23) : error C2146: syntax error : missing ';' before identifier 'size_type'
D:\Data\Dev\CMS\2.0\2.0.0\2.0.0.3\Code\CMS\Src\System.cpp(456) : see reference to class template instantiation 'std::vector<long,class CSystem *>' being compiled
d:\program files\microsoft visual studio\vc98\include\vector(23) : error C2868: 'size_type' : illegal syntax for using-declaration; expected qualified-name
D:\Data\Dev\CMS\2.0\2.0.0\2.0.0.3\Code\CMS\Src\System.cpp(456) : see reference to class template instantiation 'std::vector<long,class CSystem *>' being compiled
d:\program files\microsoft visual studio\vc98\include\vector(24) : error C2039: 'difference_type' : is not a member of '`global namespace''
D:\Data\Dev\CMS\2.0\2.0.0\2.0.0.3\Code\CMS\Src\System.cpp(456) : see reference to class template instantiation 'std::vector<long,class CSystem *>' being compiled
etc
etc
etc
#5
Re: Hi this is Terry
Posted 29 March 2006 - 08:58 AM
Hi Terry! If you're still having problems, post that in the VB forum so one of our folks can take a look for you, not many people look in the introduce yourself forum.
Welcome to dream.in.code! Hope we can help get everything working for you.
Welcome to dream.in.code! Hope we can help get everything working for you.
#6
Re: Hi this is Terry
Posted 03 April 2006 - 12:52 PM
Welcome to Dream.In.Code Terry!! My name is Mark and I’m one of the resident Team Members here on DIC. If you have any community related questions feel free to ask any of us. DIC is the perfect place for new comers to expand their knowledge about Programming and Web Development. I know I’ve learned a lot from this place and I’m sure you will too!
Page 1 of 1
|
|

New Topic/Question


MultiQuote






|