[AGENT++] [SNMP++] Compilation error
COMPAN Arnaud
compan at ipanematech.com
Thu Oct 16 16:14:04 CEST 2008
Hi all,
When compiling SNMP++ v3.2.23, I've got these errors:
c:\dev\v5.1_cms_plus\libs\ipm\libs_cpp_external_2\snmp\src\uxsnmp.cpp(71
9) : error C2065: 'm_hThread' : undeclared identifier
c:\dev\v5.1_cms_plus\libs\ipm\libs_cpp_external_2\snmp\src\uxsnmp.cpp(72
0) : error C2065: 'm_hThreadEndEvent' : undeclared identifier
c:\dev\v5.1_cms_plus\libs\ipm\libs_cpp_external_2\snmp\src\uxsnmp.cpp(95
6) : error C3861: 'm_hThreadEndEvent': identifier not found, even with
argument-dependent lookup
It's probably related to the fact that I've #defined _NO_THREADS in
config_snmp_pp.h.
I've fixed the error with this simple patch:
Index: src/uxsnmp.cpp
===================================================================
RCS file:
/export/commun/ipm/reference_v3/ipm/libs_cpp_external_2/snmp/src/uxsnmp.
cpp,v
retrieving revision 1.1.1.1.92.1
diff -u -r1.1.1.1.92.1 uxsnmp.cpp
--- src/uxsnmp.cpp 16 Oct 2008 12:41:24 -0000 1.1.1.1.92.1
+++ src/uxsnmp.cpp 16 Oct 2008 13:36:58 -0000
@@ -716,9 +716,11 @@
const unsigned short port_v6)
{
#ifdef WIN32
+#ifdef _THREADS
m_hThread = INVALID_HANDLE_VALUE;
m_hThreadEndEvent = ::CreateEvent(NULL, true, false, NULL);
#endif
+#endif
eventListHolder = new EventListHolder(this);
// initialize the request_id
@@ -953,8 +955,10 @@
stop_poll_thread();
#ifdef WIN32
+#ifdef _THREADS
::CloseHandle(m_hThreadEndEvent);
#endif
+#endif
// if we failed during construction then don't try
// to free stuff up that was not allocated
Hope this helps,
Arnaud
More information about the AGENTPP
mailing list