Skip to content

Build failure on Windows when using CURL (e.g. error C2061: syntax error: identifier 'curl_socket_t') #3148

@SebTV

Description

@SebTV

This line

#define _WINSOCKAPI_

#ifdef HAVE_WINSOCK2_H
   #define _WINSOCKAPI_
#endif

Has a side-effect on curl. It disables the include of winsock2.h and causes a lot of errors like
include\curl/curl.h(141,16): error C2061: syntax error: identifier 'curl_socket_t'

Curls checks:

#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
      defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
/* The check above prevents the winsock2.h inclusion if winsock.h already was
   included, since they cannot co-exist without problems */
#include <winsock2.h>

Please re-consider setting _WINSOCKAPI_

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions