Re: building net-SNMP for Windows 10 in minGW32

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
On 9/20/18 6:50 PM, Mark Christiansen wrote:
> On Thu, Sep 20, 2018 at 7:45 AM Bart Van Assche <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>     On 9/20/18 6:08 AM, Mark Christiansen wrote:
>      > In file included from snmp_client.c:94:0:
>      > ../include/net-snmp/types.h:68:15: error: conflicting types for
>     'socklen_t'
>      >   typedef u_int socklen_t;
>      >                 ^~~~~~~~~
> 
>     This is weird. There is a check for socklen_t in
>     configure.d/config_project_types that should have detected that MinGW
>     supports socklen_t. Can you share the config.log file that was
>     generated
>     by the configure script?
> 
> Okay. I attached the file because there Gmail apparently doesn't want me 
> to paste 70,000 lines of text.

Can you check whether socklen_t is corrected detected correctly after 
having applied the patch below?

Thanks,

Bart.

Subject: [PATCH] MinGW: Detect socklen_t correctly

Reported-by: Mark Christiansen <[email protected]>
---
  configure                        | 6 ++++++
  configure.d/config_project_types | 6 ++++++
  2 files changed, 12 insertions(+)

diff --git a/configure b/configure
index cad6b74486c3..195f45dde88a 100755
--- a/configure
+++ b/configure
@@ -26555,6 +26555,12 @@ _ACEOF
  #   Check for 'socklen_t'                           (HP-UX)
  #
  ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
  #include <sys/types.h>
  #if STDC_HEADERS
  #include <stdlib.h>
diff --git a/configure.d/config_project_types 
b/configure.d/config_project_types
index b789b3d62f44..e5ed9ef21cdd 100644
--- a/configure.d/config_project_types
+++ b/configure.d/config_project_types
@@ -37,6 +37,12 @@ AC_DEFINE_UNQUOTED([NETSNMP_ATTRIBUTE_UNUSED], [${attr}],
  #   Check for 'socklen_t'                           (HP-UX)
  #
  AC_CHECK_TYPES([socklen_t],,,[
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
  #include <sys/types.h>
  #if STDC_HEADERS
  #include <stdlib.h>


_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.