Agent++v3.3e Con not compile with MS Visual c++ 5.0 under NT?
haka
newHaka____21cn.com
Wed Apr 26 14:10:08 CEST 2000
Hello,everybody,
I want to compile Agent++V3.3e with MS Visual C++ 5.0(no SP)
under NT But I am not success,the compiler report syntax error,as follow:
-----------------------compile output ----------------------------------
cl.exe /nologo /MT /W3 /GX /O2 /TP /D "WIN32" /D "NDEBUG" /D
"_WINDOWS" /D "_MBCS" /D "AGENT_PP_NATIVE_EXPORTS" /YX /FD /c /I../include
/I..\..\snmp++/include request.cpp
request.cpp
../include\List.h(588) : error C2678: binary '<' : no operator defined
which takes a left-hand operand of type 'class Request' (or there is no
acceptable conversion)
../include\List.h(603) : error C2678: binary '==' : no operator defined
which takes a left-hand operand of type 'class Request' (or there is no
acceptable conversion)
../include\List.h(607) : error C2678: binary '<' : no operator defined
which takes a left-hand operand of type 'class Request' (or there is no
acceptable conversion)
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
-----------------------------------------------------------------------
But I can not find any wrong in source file(as follow).
How should I do ?
Thanks!
--------------------source ------------------------------
template <class T> class OrderedList {
friend ListCursor<T>;
public:
T* add(T* item) {
if (!content.empty()) {
ListCursor<T> cur;
for (cur.init(&content); cur.get(); cur.next()) {
if (*item < *cur.get()) //VC++ report error!
^^^^^^^^^^^^^^^^^^^^^^^^
return content.insertBefore(item, cur.get());
}
return content.add(item);
}
else return content.add(item);
}
// add a new item, but if an equal item already exists:
// do not change the list, delete the new item and return 0
T* addUnique(T* item) {
if (!content.empty()) {
ListCursor<T> cur;
for (cur.init(&content); cur.get(); cur.next()) {
if (*item == *cur.get()) { //VC++ report error!
^^^^^^^^^^^^^^^^^^^^^^^^
delete item;
return 0;
}
if (*item < *cur.get()) //VC++ report error!
^^^^^^^^^^^^^^^^^^^^^^^^
return content.insertBefore(item, cur.get());
}
return content.add(item);
}
else return content.add(item);
}
More information about the AGENTPP
mailing list