warmcat / libwebsockets

canonical libwebsockets.org networking library
https://libwebsockets.org
Other
4.67k stars 1.46k forks source link

android build error #2739

Open calvin2021y opened 1 year ago

calvin2021y commented 1 year ago

build with from master

CMAKE_COLOR_MAKEFILE:BOOL=ON
LWS_LOGS_TIMESTAMP:BOOL=ON
LWS_LOG_TAG_LIFECYCLE:BOOL=ON
LWS_PLAT_ANDROID:BOOL=ON
LWS_ROLE_H1:BOOL=ON
LWS_ROLE_WS:BOOL=ON
LWS_SUPPRESS_DEPRECATED_API_WARNINGS:BOOL=ON
LWS_WITHOUT_DAEMONIZE:BOOL=ON
LWS_WITHOUT_EXTENSIONS:BOOL=ON
LWS_WITHOUT_TESTAPPS:BOOL=ON
LWS_WITHOUT_TEST_CLIENT:BOOL=ON
LWS_WITHOUT_TEST_PING:BOOL=ON
LWS_WITHOUT_TEST_SERVER:BOOL=ON
LWS_WITHOUT_TEST_SERVER_EXTPOLL:BOOL=ON
LWS_WITH_CONMON:BOOL=ON
LWS_WITH_DIR:BOOL=ON
LWS_WITH_GZINFLATE:BOOL=ON
LWS_WITH_HTTP2:BOOL=ON
LWS_WITH_HTTP_BASIC_AUTH:BOOL=ON
LWS_WITH_HTTP_UNCOMMON_HEADERS:BOOL=ON
LWS_WITH_LIBUV:BOOL=ON
LWS_WITH_NETWORK:BOOL=ON
LWS_WITH_SSL:BOOL=ON
LWS_WITH_STATIC:BOOL=ON
LWS_WITH_SYS_ASYNC_DNS:BOOL=ON
LWS_WITH_TLS_SESSIONS:BOOL=ON
LWS_WITH_UDP:BOOL=ON
LWS_WITH_ZLIB:BOOL=ON

get error:


[  1%] Creating build include dir
[  1%] Built target GENHDR
[  3%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-misc.c.o
[  5%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-caps.c.o
[  5%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-pipe.c.o
[  7%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-service.c.o
[  7%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-init.c.o
[ 11%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-sockets.c.o
[ 11%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/unix-fds.c.o
[ 13%] Building C object lib/CMakeFiles/websockets.dir/plat/unix/android/android-resolv.c.o
[ 13%] Building C object lib/CMakeFiles/websockets.dir/tls/tls.c.o
[ 16%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-sessions.c.o
[ 16%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-network.c.o
[ 16%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-tls.c.o
[ 18%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-x509.c.o
[ 18%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-ssl.c.o
[ 21%] Building C object lib/CMakeFiles/websockets.dir/tls/openssl/openssl-session.c.o
[ 21%] Building C object lib/CMakeFiles/websockets.dir/tls/tls-server.c.o
In file included from lws/lib/plat/unix/unix-service.c:28:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/tls/tls-network.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/tls/openssl/openssl-session.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/tls/openssl/openssl-ssl.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/plat/unix/unix-misc.c:28:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/plat/unix/unix-init.c:28:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/tls/tls-network.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.h:588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
In file included from lws/lib/tls/openssl/openssl-session.c:25:
In file included from lws/lib/core/./private-lib-core.hIn file included from :lws/lib/tls/tls-sessions.c146::
25In file included from :
lws/include/libwebsockets.hIn file included from :lws/lib/core/./private-lib-core.h801::
146:
lws/include/libwebsockets/lws-html.hIn file included from :lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
In file included from lws/lib/plat/unix/unix-service.c:28:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.h:588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
In file included from lws/lib/tls/openssl/openssl-ssl.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.h:588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
In file included from lws/lib/plat/unix/unix-misc.c} lhp_ctx_t;:
28:
  ^In file included from 
lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:lws/include/libwebsockets/lws-dlo.h801::
463:lws/include/libwebsockets/lws-html.h24::588 :3note: : previous definition is here
error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lhp_ctx lhp_ctx_t;
} lhp_ctx_t;
                       ^
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
In file included from lws/lib/tls/openssl/openssl-tls.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.hIn file included from :lws/lib/plat/unix/unix-caps.c161::283:
:In file included from  lws/lib/core/./private-lib-core.h:146note: :
In file included from previous definition is herelws/include/libwebsockets.h:
790:
lws/include/libwebsockets/lws-dlo.h:270:} lws_display_state_t;34
:   ^
error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
In file included from lws/lib/tls/openssl/openssl-x509.c:26:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.htypedef struct lws_display_state lws_display_state_t;:
270:                                 ^34
: In file included from lws/include/libwebsockets/lws-display.h:lws/lib/plat/unix/unix-init.c161::283:
:In file included from  lws/lib/core/./private-lib-core.h:146note: :
In file included from previous definition is herelws/include/libwebsockets.h:
801:
lws/include/libwebsockets/lws-html.h:588:} lws_display_state_t;3
:   ^
error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/tls/tls.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/tls/tls-sessions.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.h:588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
In file included from lws/lib/plat/unix/unix-fds.c:28:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
In file included from lws/lib/plat/unix/unix-sockets.c:28:
In file included from typedef struct lws_display_state lws_display_state_t;lws/lib/core/./private-lib-core.h
:146                                 ^:

In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: lws/include/libwebsockets/lws-display.h:error: 161:3:redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition] 
note: previous definition is here
} lws_display_state_t;
  ^
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/plat/unix/unix-pipe.c:28:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/tls/openssl/openssl-tls.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.h:588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
In file included from lws/lib/tls/openssl/openssl-x509.c:26:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
In file included from lws/lib/tls/tls.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:lws/include/libwebsockets/lws-html.h:588:3: error: 801redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]:

lws/include/libwebsockets/lws-html.h:588:3: } lhp_ctx_t;
error:   ^
redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
lws/include/libwebsockets/lws-dlo.h:463} lhp_ctx_t;:
24:  ^ 
note: previous definition is herelws/include/libwebsockets/lws-dlo.h:
463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
typedef struct lhp_ctx lhp_ctx_t;
                       ^
typedef struct lhp_ctx lhp_ctx_t;
                       ^
In file included from lws/lib/tls/tls-server.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/plat/unix/android/android-resolv.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:790:
lws/include/libwebsockets/lws-dlo.h:270:34: error: redefinition of typedef 'lws_display_state_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef struct lws_display_state lws_display_state_t;
                                 ^
lws/include/libwebsockets/lws-display.h:161:3: note: previous definition is here
} lws_display_state_t;
  ^
In file included from lws/lib/plat/unix/unix-fds.c:28:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.h:588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: In file included from lws/lib/plat/unix/unix-caps.c:note: 28:
previous definition is hereIn file included from lws/lib/core/./private-lib-core.h
:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.htypedef struct lhp_ctx lhp_ctx_t;:
588:                       ^3
: In file included from lws/lib/plat/unix/unix-sockets.cerror: :28:
redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]In file included from lws/lib/core/./private-lib-core.h
:146:
In file included from lws/include/libwebsockets.h:801} lhp_ctx_t;:

lws/include/libwebsockets/lws-html.h  ^:
588:3: lws/include/libwebsockets/lws-dlo.herror: :463:redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]24:
 note: previous definition is here
} lhp_ctx_t;
  ^
typedef struct lhp_ctx lhp_ctx_t;lws/include/libwebsockets/lws-dlo.h
:463:                       ^24
: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
In file included from lws/lib/plat/unix/unix-pipe.c:28:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.h:588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
In file included from lws/lib/tls/tls-server.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.h:588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
In file included from lws/lib/plat/unix/android/android-resolv.c:25:
In file included from lws/lib/core/./private-lib-core.h:146:
In file included from lws/include/libwebsockets.h:801:
lws/include/libwebsockets/lws-html.h:588:3: error: redefinition of typedef 'lhp_ctx_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
} lhp_ctx_t;
  ^
lws/include/libwebsockets/lws-dlo.h:463:24: note: previous definition is here
typedef struct lhp_ctx lhp_ctx_t;
                       ^
calvin2021y commented 1 year ago

windows also build error. need add cmake option to disable "display" related build.

inobelar commented 8 months ago

@calvin2021y Greetings! Probably it was resolved in (issue https://github.com/warmcat/libwebsockets/issues/3002) (commit https://github.com/warmcat/libwebsockets/commit/48e09ddf51ea014a60d666f8eb780cd801c0d4b5)