问:
Cannot build curl with openssl (MinGW)
I am using msys(MinGW32) to compile curl with openssl. It giving me '__errno' errors.

I changes following parameters as suggested on a github issue:
from OPENSSL_LIBS = -lcrypto -lssl
to   OPENSSL_LIBS = -lssl -lcrypto

which reduced alot of other errors but stil I cannot compile it properly.

OpenSSL v1.1.1b was compiled successfully with MinGW32. Curl version is 7.65.0.
I am using following command to build it:
mingw32-make mingw32-ssl

```Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _gethostbyname by linking to _gethostbyname@4
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _setsockopt by linking to _setsockopt@20
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _getsockname by linking to _getsockname@12
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _socket by linking to _socket@12
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _connect by linking to _connect@12
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _bind by linking to _bind@12
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(rec_layer_s3.o):rec_layer_s3.c:(.text+0x3bb): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(rec_layer_s3.o):rec_layer_s3.c:(.text+0x705): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(s3_lib.o):s3_lib.c:(.text+0x243a): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(s3_lib.o):s3_lib.c:(.text+0x24e4): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(s3_lib.o):s3_lib.c:(.text+0x2634): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(ssl_cert.o):ssl_cert.c:(.text+0x1da1): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xbc): undefined reference to `getnameinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xff): undefined reference to `gai_strerror'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x241): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xd9a): undefined reference to `getaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xdb0): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xeaa): undefined reference to `gai_strerror'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xf1f): undefined reference to `freeaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x1132): undefined reference to `getaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x1148): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x124a): undefined reference to `gai_strerror'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x12bf): undefined reference to `freeaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x93b): undefined reference to `freeaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x2b1): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x30c): undefined reference to `ioctl'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x321): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x671): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x734): undefined reference to `ioctl'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x751): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x851): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x48): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x130): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x1c2): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x277): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x644): undefined reference to `listen'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x691): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x721): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x7be): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x81e): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x8be): undefined reference to `accept'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x901): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x7d4): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x88f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0xa2c): undefined reference to `shutdown'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0xb46): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0xe55): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0xfd3): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x10f6): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x1405): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x1583): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(conf_mod.o):conf_mod.c:(.text+0xe01): undefined reference to `__locale_ctype_ptr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(conf_mod.o):conf_mod.c:(.text+0xe84): undefined reference to `__locale_ctype_ptr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(eng_ctrl.o):eng_ctrl.c:(.text+0x206): undefined reference to `stpcpy'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x218): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x2cc): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x948): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x9bb): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0xfc6): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x1039): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xb4b): undefined reference to `sysconf'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xb9c): undefined reference to `mmap'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xc36): undefined reference to `mlock'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xcbf): undefined reference to `munmap'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xea8): undefined reference to `munmap'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0x1f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0x9f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0xb6): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0xc1): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0xd5): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0x12a): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_str.o):o_str.c:(.text+0x5ab): undefined reference to `__xpg_strerror_r'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_time.o):o_time.c:(.text+0x14): undefined reference to `gmtime_r'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x1e2): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x321): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x32c): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x4a6): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x51f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(randfile.o):randfile.c:(.text+0x193): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x1b): undefined reference to `pthread_atfork'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x62): undefined reference to `pthread_rwlock_init'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x9b): undefined reference to `pthread_rwlock_rdlock'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0xbb): undefined reference to `pthread_rwlock_wrlock'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0xdb): undefined reference to `pthread_rwlock_unlock'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x100): undefined reference to `pthread_rwlock_destroy'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x143): undefined reference to `pthread_once'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x173): undefined reference to `pthread_key_create'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x1b5): undefined reference to `pthread_setspecific'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x1dd): undefined reference to `pthread_key_delete'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x243): undefined reference to `pthread_once'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x19b): undefined reference to `pthread_getspecific'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x1f1): undefined reference to `pthread_self'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x201): undefined reference to `pthread_equal'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x14): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x2c): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x123): undefined reference to `sigaction'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x268): undefined reference to `tcsetattr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x355): undefined reference to `sigaction'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x424): undefined reference to `tcsetattr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x658): undefined reference to `tcgetattr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x671): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x67f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x68d): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x69b): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x6a5): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x6af): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x741): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x753): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(uid.o):uid.c:(.text+0x5): undefined reference to `getuid'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(uid.o):uid.c:(.text+0xc): undefined reference to `geteuid'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(uid.o):uid.c:(.text+0x21): undefined reference to `getgid'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(uid.o):uid.c:(.text+0x28): undefined reference to `getegid'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x335): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(eng_openssl.o):eng_openssl.c:(.text+0xa): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(eng_openssl.o):eng_openssl.c:(.text+0x1ab): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0xe21): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x1034): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x112f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x1140): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x1c2a): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x1ca4): more undefined references to `__errno' follow
collect2.exe: error: ld returned 1 exit status
Makefile.m32:369: recipe for target 'libcurl.dll' failed
mingw32-make[1]: *** [libcurl.dll] Error 1
mingw32-make[1]: Leaving directory 'c:/Users/John/Downloads/curl/curl-7.65.0/lib'
Makefile:61: recipe for target 'mingw32-ssl' failed
mingw32-make: *** [mingw32-ssl] Error
```

What should I do so that I can build curl with openssl successfully ?

答:
I deleted old compiled files. Started again.
Compiled Openssl v1.1.1b, then built curl v7.65.0 with Openssl v1.1.1b. It worked.</p>

Title: Cannot build curl with openssl (MinGW)

Body:
I am using msys(MinGW32) to compile curl with openssl. It giving me '__errno' errors.

I changes following parameters as suggested on a github issue:
from OPENSSL_LIBS = -lcrypto -lssl
to   OPENSSL_LIBS = -lssl -lcrypto

which reduced alot of other errors but stil I cannot compile it properly.

OpenSSL v1.1.1b was compiled successfully with MinGW32. Curl version is 7.65.0.
I am using following command to build it:
mingw32-make mingw32-ssl

Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _gethostbyname by linking to _gethostbyname@4
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _setsockopt by linking to _setsockopt@20
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _getsockname by linking to _getsockname@12
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _socket by linking to _socket@12
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _connect by linking to _connect@12
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: warning: resolving _bind by linking to _bind@12
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(rec_layer_s3.o):rec_layer_s3.c:(.text+0x3bb): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(rec_layer_s3.o):rec_layer_s3.c:(.text+0x705): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(s3_lib.o):s3_lib.c:(.text+0x243a): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(s3_lib.o):s3_lib.c:(.text+0x24e4): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(s3_lib.o):s3_lib.c:(.text+0x2634): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libssl.a(ssl_cert.o):ssl_cert.c:(.text+0x1da1): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xbc): undefined reference to `getnameinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xff): undefined reference to `gai_strerror'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x241): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xd9a): undefined reference to `getaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xdb0): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xeaa): undefined reference to `gai_strerror'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0xf1f): undefined reference to `freeaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x1132): undefined reference to `getaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x1148): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x124a): undefined reference to `gai_strerror'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x12bf): undefined reference to `freeaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_addr.o):b_addr.c:(.text+0x93b): undefined reference to `freeaddrinfo'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x2b1): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x30c): undefined reference to `ioctl'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x321): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x671): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x734): undefined reference to `ioctl'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x751): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock.o):b_sock.c:(.text+0x851): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x48): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x130): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x1c2): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x277): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x644): undefined reference to `listen'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x691): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x721): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x7be): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x81e): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x8be): undefined reference to `accept'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x901): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x7d4): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x88f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0xa2c): undefined reference to `shutdown'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0xb46): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0xe55): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0xfd3): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x10f6): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x1405): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(bss_conn.o):bss_conn.c:(.text+0x1583): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(conf_mod.o):conf_mod.c:(.text+0xe01): undefined reference to `__locale_ctype_ptr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(conf_mod.o):conf_mod.c:(.text+0xe84): undefined reference to `__locale_ctype_ptr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(eng_ctrl.o):eng_ctrl.c:(.text+0x206): undefined reference to `stpcpy'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x218): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x2cc): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x948): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x9bb): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0xfc6): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(err.o):err.c:(.text+0x1039): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xb4b): undefined reference to `sysconf'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xb9c): undefined reference to `mmap'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xc36): undefined reference to `mlock'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xcbf): undefined reference to `munmap'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(mem_sec.o):mem_sec.c:(.text+0xea8): undefined reference to `munmap'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0x1f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0x9f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0xb6): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0xc1): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0xd5): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_dir.o):o_dir.c:(.text+0x12a): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_str.o):o_str.c:(.text+0x5ab): undefined reference to `__xpg_strerror_r'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(o_time.o):o_time.c:(.text+0x14): undefined reference to `gmtime_r'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x1e2): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x321): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x32c): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x4a6): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(rand_unix.o):rand_unix.c:(.text+0x51f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(randfile.o):randfile.c:(.text+0x193): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x1b): undefined reference to `pthread_atfork'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x62): undefined reference to `pthread_rwlock_init'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x9b): undefined reference to `pthread_rwlock_rdlock'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0xbb): undefined reference to `pthread_rwlock_wrlock'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0xdb): undefined reference to `pthread_rwlock_unlock'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x100): undefined reference to `pthread_rwlock_destroy'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x143): undefined reference to `pthread_once'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x173): undefined reference to `pthread_key_create'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x1b5): undefined reference to `pthread_setspecific'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x1dd): undefined reference to `pthread_key_delete'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x243): undefined reference to `pthread_once'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x19b): undefined reference to `pthread_getspecific'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x1f1): undefined reference to `pthread_self'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(threads_pthread.o):threads_pthread.c:(.text+0x201): undefined reference to `pthread_equal'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x14): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x2c): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x123): undefined reference to `sigaction'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x268): undefined reference to `tcsetattr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x355): undefined reference to `sigaction'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x424): undefined reference to `tcsetattr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x658): undefined reference to `tcgetattr'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x671): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x67f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x68d): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x69b): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x6a5): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x6af): more undefined references to `__errno' follow
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x741): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:(.text+0x753): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(uid.o):uid.c:(.text+0x5): undefined reference to `getuid'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(uid.o):uid.c:(.text+0xc): undefined reference to `geteuid'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(uid.o):uid.c:(.text+0x21): undefined reference to `getgid'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(uid.o):uid.c:(.text+0x28): undefined reference to `getegid'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x335): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(eng_openssl.o):eng_openssl.c:(.text+0xa): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(eng_openssl.o):eng_openssl.c:(.text+0x1ab): undefined reference to `__getreent'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0xe21): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x1034): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x112f): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x1140): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x1c2a): undefined reference to `__errno'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\OpenSSLx86/lib/libcrypto.a(loader_file.o):loader_file.c:(.text+0x1ca4): more undefined references to `__errno' follow
collect2.exe: error: ld returned 1 exit status
Makefile.m32:369: recipe for target 'libcurl.dll' failed
mingw32-make[1]: *** [libcurl.dll] Error 1
mingw32-make[1]: Leaving directory 'c:/Users/John/Downloads/curl/curl-7.65.0/lib'
Makefile:61: recipe for target 'mingw32-ssl' failed
mingw32-make: *** [mingw32-ssl] Error

What should I do so that I can build curl with openssl successfully ?


来源: stackexchange

问:
What is the most efficient way to make random label location adjust to window size?
I have a label centered by the X coordinate on a form, and I'm trying to make it adjust its location on form resize.
So, I'm handling the Resize event to update label Location property.

```<code>private void SecondaryWindow_Resize(object sender, EventArgs e)
{
    lblStartPointX = this.Width / 2 - lblSecondary1.Width / 2;
    lblStartPointY = lblSecondary1.Location.Y;
    lblSecondary1.Location = new Point(lblStartPointX, lblStartPointY);
}
</code>```

It seems I can't directly assign some value to lblSecondary1.Location.X property (compiler considers it a mistake), so I came up with this code.

But it strikes me as not very efficient way to do the task... Just how much Point objects are created if you constantly resize the window, I wonder?

答:
you can use : 2 options
1) go to label properties in that goto Layout >> Anchor then set the anchor as you want it.
2) go to label properties in that goto Layout >> Dock then set the Dock as required.</p>

ContentLicense: CC BY-SA 4.0

Body:
I have a label centered by the X coordinate on a form, and I'm trying to make it adjust its location on form resize.
So, I'm handling the Resize event to update label Location property.

private void SecondaryWindow_Resize(object sender, EventArgs e)
{
    lblStartPointX = this.Width / 2 - lblSecondary1.Width / 2;
    lblStartPointY = lblSecondary1.Location.Y;
    lblSecondary1.Location = new Point(lblStartPointX, lblStartPointY);
}

It seems I can't directly assign some value to lblSecondary1.Location.X property (compiler considers it a mistake), so I came up with this code.

But it strikes me as not very efficient way to do the task... Just how much Point objects are created if you constantly resize the window, I wonder?


问:
Swap key with value in object
I have an extremely large JSON object structured like this:

```<code>{A : 1, B : 2, C : 3, D : 4}
</code>```

I need a function that can swap the values with keys in my object and I don't know how to do it. I would need an output like this:

```<code>{1 : A, 2 : B, 3 : C, 4 : D}
</code>```

Is there any way that I can do this would manually created a new object where everything is swapped?

Thanks

答:
With pure Ramda in a pure and point-free style:

```<code>const swapKeysAndValues = R.pipe(
   R.toPairs,
   R.map(R.reverse),
   R.fromPairs,
);
</code>```

Or, with a little more convoluted ES6 version, still pure functional:

```<code>const swapKeysAndValues2 = obj => Object
    .entries(obj)
    .reduce((newObj, [key, value]) => ({...newObj, [value]: key}), {})
</code>```

Title: Swap key with value in object

Body:
I have an extremely large JSON object structured like this:

{A : 1, B : 2, C : 3, D : 4}

I need a function that can swap the values with keys in my object and I don't know how to do it. I would need an output like this:

{1 : A, 2 : B, 3 : C, 4 : D}

Is there any way that I can do this would manually created a new object where everything is swapped?

Thanks

Body:
With pure Ramda in a pure and point-free style:

const swapKeysAndValues = R.pipe(
   R.toPairs,
   R.map(R.reverse),
   R.fromPairs,
);

Or, with a little more convoluted ES6 version, still pure functional:

const swapKeysAndValues2 = obj => Object
    .entries(obj)
    .reduce((newObj, [key, value]) => ({...newObj, [value]: key}), {})


问:
Busy DataReader breaking my Web Site
So ... I've got some static class with some method which returns some data to my Data Tables.

The trouble is multi-access to this method. When to different Client Sessions call this method in the same time DataReaded fails with error that I need to close current command (DataReader) before start new one. I even tried to use Lock but this didn't made any sense.

```<code>    private RepGroupsDataSourcelocker = Object()
    public RepGroupsDataSource() : array[(string * int)]
        lock(RepGroupsDataSourcelocker)
            def res = linq<#from pr in _Rep_Permission
                    from rg in _Rep_Group
                    where (pr.ID_User == System.Web.HttpContext.Current.User.Identity.Name)
                    where (rg.RepGroup_ID == pr.ID_RepGroup)
                    order by rg.nOrder
                    select (rg.RepGroup_Name, rg.RepGroup_ID)
                    #>
            res.Take(7).ToArray()
</code>```

That is only example code , it fails on any linq2sql , SqlAdapter Fill commands.

Here is details :

```<code>System.InvalidOperationException was unhandled by user code
      Message = There is a designated this command Command open DataReader, which requires the prior close.
      Source = System.Data
      StackTrace:
           in System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute (SqlCommand command)
           in System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute (String method, SqlCommand command)
           in System.Data.SqlClient.SqlCommand.ValidateCommand (String method, Boolean async)
           in System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
           in System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
           at System.Data.SqlClient.SqlCommand.ExecuteReader (CommandBehavior behavior, String method)
           in System.Data.SqlClient.SqlCommand.ExecuteDbDataReader (CommandBehavior behavior)
           in System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader (CommandBehavior behavior)
           in System.Data.Common.DbDataAdapter.FillInternal (DataSet dataset, DataTable [] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
           in System.Data.Common.DbDataAdapter.Fill (DataTable [] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
           in System.Data.Common.DbDataAdapter.Fill (DataTable dataTable)
           in Flow_WEB_Nemerle.SQLModule.GetReport (String Param1, Int32 Param2, Int32 Group, Int32 DayOfMonth, String ContactHour, Int32 MyCase, Boolean ForDia, Int32 step, Int32 maximumRows, Int32 startRowIndex) in D: \ SVN \ FlowServer \ trunk \ FS WEB \ Flow_WEB_Nemerle2 \ SQLReportModule.n: line 96
      InnerException:
</code>```

How can I avoid this troubles without creating a Windows Service / WCF for it. I want really fast solution ... Maybe I need dynamic class with methods ?

答:
The web server uses several threads for handling requests. If they all use the same database connection, that is a bottle neck for the site.

You should use a separate database connection for each request. That way there is no concurrency problems between the threads, and you don't create an unneccesary bottle neck.

ContentLicense: CC BY-SA 3.0

Title: Busy DataReader breaking my Web Site

Body:
So ... I've got some static class with some method which returns some data to my Data Tables.

The trouble is multi-access to this method. When to different Client Sessions call this method in the same time DataReaded fails with error that I need to close current command (DataReader) before start new one. I even tried to use Lock but this didn't made any sense.

    private RepGroupsDataSourcelocker = Object()
    public RepGroupsDataSource() : array[(string * int)]
        lock(RepGroupsDataSourcelocker)
            def res = linq<#from pr in _Rep_Permission
                    from rg in _Rep_Group
                    where (pr.ID_User == System.Web.HttpContext.Current.User.Identity.Name)
                    where (rg.RepGroup_ID == pr.ID_RepGroup)
                    order by rg.nOrder
                    select (rg.RepGroup_Name, rg.RepGroup_ID)
                    #>
            res.Take(7).ToArray()

That is only example code , it fails on any linq2sql , SqlAdapter Fill commands.

Here is details :

System.InvalidOperationException was unhandled by user code
      Message = There is a designated this command Command open DataReader, which requires the prior close.
      Source = System.Data
      StackTrace:
           in System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute (SqlCommand command)
           in System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute (String method, SqlCommand command)
           in System.Data.SqlClient.SqlCommand.ValidateCommand (String method, Boolean async)
           in System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
           in System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
           at System.Data.SqlClient.SqlCommand.ExecuteReader (CommandBehavior behavior, String method)
           in System.Data.SqlClient.SqlCommand.ExecuteDbDataReader (CommandBehavior behavior)
           in System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader (CommandBehavior behavior)
           in System.Data.Common.DbDataAdapter.FillInternal (DataSet dataset, DataTable [] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
           in System.Data.Common.DbDataAdapter.Fill (DataTable [] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
           in System.Data.Common.DbDataAdapter.Fill (DataTable dataTable)
           in Flow_WEB_Nemerle.SQLModule.GetReport (String Param1, Int32 Param2, Int32 Group, Int32 DayOfMonth, String ContactHour, Int32 MyCase, Boolean ForDia, Int32 step, Int32 maximumRows, Int32 startRowIndex) in D: \ SVN \ FlowServer \ trunk \ FS WEB \ Flow_WEB_Nemerle2 \ SQLReportModule.n: line 96
      InnerException:

How can I avoid this troubles without creating a Windows Service / WCF for it. I want really fast solution ... Maybe I need dynamic class with methods ?


问:
How to override DISTRO_VERSION?
I'm populating an sdk using the command bitbake <image> -c populate_sdk and the resulting *.sh installer file has an version number which is the same as the DISTRO_VERSION. (yocto poky)

I tried to override the DISTRO_VERSION in build/conf/local.conf, but it does not override the existing DISTRO_VERSION, I do not understand why

答:
To change SDK version, you need to use SDK_VERSION variable defined in poky as:

```<code>SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}','snapshot')}"
</code>```

Title: How to override DISTRO_VERSION?

Body:
To change SDK version, you need to use SDK_VERSION variable defined in poky as:

SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}','snapshot')}"


问:
Error uploading image file to Google Drive using REST API
I am working with the Google Drive for the first time. I am trying to upload a jpg file to my Google Drive through my app. I have completed the OAuth 2.0 authorization for account login and drive permission. I have successfully uploaded the file to Google Drive also following the instructions given here https://developers.google.com/drive/api/v3/manage-uploads?refresh=1

The issue is with the uploaded file. The image is not saved there as an image. What should be the form of the request body here?

Here is the code snippet I have used to upload the image file using Google REST API.

```<code>OkHttpClient client = new OkHttpClient();
            RequestBody body = RequestBody.create(MediaType.parse("application/json"), file);
            Request request = new Request.Builder()
                    .url("https://www.googleapis.com/upload/drive/v3/files?uploadType=media")
                    .addHeader("Content-Type", "image/jpeg")
                    .addHeader("Content-Length", "36966.4")
                    .addHeader("Authorization", String.format("Bearer %s", accessToken))
                    .post(body)
                    .build();
            Response response = null;
            try {
                response = client.newCall(request).execute();
                successCode = String.valueOf(response.code());
            }catch (IOException e){
                e.printStackTrace();
            }
</code>```

Here "file" is the Base64 encoded string of the image.

Its just giving the expected http ok 200 code. Also need to know how to set the title for the file while uploading on Google Drive.

答:
You have mentioned wrong content type in the request. It should be</p>

```<code>RequestBody body = RequestBody.create(MediaType.parse("image/jpeg"), file);
</code>```

Body:
I am working with the Google Drive for the first time. I am trying to upload a jpg file to my Google Drive through my app. I have completed the OAuth 2.0 authorization for account login and drive permission. I have successfully uploaded the file to Google Drive also following the instructions given here https://developers.google.com/drive/api/v3/manage-uploads?refresh=1

The issue is with the uploaded file. The image is not saved there as an image. What should be the form of the request body here?

Here is the code snippet I have used to upload the image file using Google REST API.

OkHttpClient client = new OkHttpClient();
            RequestBody body = RequestBody.create(MediaType.parse("application/json"), file);
            Request request = new Request.Builder()
                    .url("https://www.googleapis.com/upload/drive/v3/files?uploadType=media")
                    .addHeader("Content-Type", "image/jpeg")
                    .addHeader("Content-Length", "36966.4")
                    .addHeader("Authorization", String.format("Bearer %s", accessToken))
                    .post(body)
                    .build();
            Response response = null;
            try {
                response = client.newCall(request).execute();
                successCode = String.valueOf(response.code());
            }catch (IOException e){
                e.printStackTrace();
            }

Here "file" is the Base64 encoded string of the image.

Its just giving the expected http ok 200 code. Also need to know how to set the title for the file while uploading on Google Drive.

Body:
You have mentioned wrong content type in the request. It should be

RequestBody body = RequestBody.create(MediaType.parse("image/jpeg"), file);


问:
No handlers for address "demo" when using Vert.x Event Bus
I am doing a demo on how to use the Vert.x event bus. However the messages are not sent to the consumer. All I got was

No handlers for address hello

when I invocked the service, Here is the consumer, Here is the exact example I am following, and how I am running it.

```<code>public class HelloMicroservice extends AbstractVerticle {

    @Override
    public void start() {
        vertx.eventBus().<String>consumer("hello", message -> {
            JsonObject json = new JsonObject()
                    .put("served-by", this.toString());
            if (message.body().isEmpty()) {
                message.reply(json.put("message", "hello"));
            } else {
                message.reply(json.put("message", "hello " + message.body()));
            }
        });
    }
}
</code>```

I run the verticle with the cluster flag as described in the example like this,

mvn compile vertx:run -Dvertx.runArgs="-cluster -Djava.net.preferIPv4Stack=true

Below are the logs for the first verticle

```<code>[INFO] Launching Vert.x Application
[INFO] Vert.x application redeploy enabled
[INFO] No plugin execution collected. The vertx:initialize goal has not been run beforehand. Only handling resources and java compilation
[INFO] Observing path:/Users/isaack/reactivejava_ws/message_driven_ms/src/main
[INFO] May 24, 2019 1:31:42 PM io.vertx.core.impl.launcher.commands.Watcher
[INFO] INFO: Watched paths: [/Users/isaack/reactivejava_ws/message_driven_ms/target/classes]
[INFO] May 24, 2019 1:31:42 PM io.vertx.core.impl.launcher.commands.Watcher
[INFO] INFO: Starting the vert.x application in redeploy mode
[INFO] Starting vert.x application...
[INFO] bd066fa5-6786-45dc-9044-b08adbf80cb9-redeploy
[INFO] May 24, 2019 1:31:43 PM io.vertx.core.impl.launcher.commands.RunCommand
[INFO] INFO: Starting clustering...
[INFO] May 24, 2019 1:31:43 PM io.vertx.core.impl.launcher.commands.RunCommand
[INFO] INFO: No cluster-host specified so using address 172.16.7.108
[INFO] May 24, 2019 1:31:44 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport start
[INFO] INFO: ISPN000078: Starting JGroups channel ISPN
[INFO] May 24, 2019 1:31:49 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport viewAccepted
[INFO] INFO: ISPN000094: Received new cluster view for channel ISPN: [Isaacs-MacBook-Pro-2-55471|0] (1) [Isaacs-MacBook-Pro-2-55471]
[INFO] May 24, 2019 1:31:49 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport startJGroupsChannelIfNeeded
[INFO] INFO: ISPN000079: Channel ISPN local address is Isaacs-MacBook-Pro-2-55471, physical addresses are [127.0.0.1:7801]
[INFO] May 24, 2019 1:31:49 PM org.infinispan.factories.GlobalComponentRegistry start
[INFO] INFO: ISPN000128: Infinispan version: Infinispan 'Ruppaner' 9.0.0.CR2
[INFO] May 24, 2019 1:31:49 PM org.infinispan.expiration.impl.ExpirationManagerImpl start
[INFO] INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread
[INFO] May 24, 2019 1:31:49 PM org.infinispan.expiration.impl.ExpirationManagerImpl start
[INFO] INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread
[INFO] May 24, 2019 1:31:50 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
[INFO] INFO: Succeeded in deploying verticle
</code>```

This is the Second Verticle that sends some messages to the consumer, Its a different project that is run separately locally.

```<code> public class BaseMicroservice extends AbstractVerticle {

    @Override
    public void start() {
        vertx.createHttpServer()
                .requestHandler(
                        req -> {
                            Single<JsonObject> obs1 = vertx.eventBus()
                                    .<JsonObject>rxSend("hello", "Luke")
                                    .map(Message::body);
                            Single<JsonObject> obs2 = vertx.eventBus()
                                    .<JsonObject>rxSend("hello", "Leia")
                                    .map(Message::body);
                            Single.zip(obs1, obs2, (luke, leia) ->
                                            new JsonObject()
                                                    .put("Luke", luke.getString("message")
                                                            + " from " + luke.getString("served-by"))
                                                    .put("Leia", leia.getString("message")
                                                            + " from " + leia.getString("served-by"))
                                    ).subscribe(
                                            x -> req.response().end(x.encodePrettily()),
                                            t -> req.response().setStatusCode(500).end(t.getMessage())
                                    );
                        })
                .listen(8082);
    }

}
</code>```

I am running with the command below.

mvn compile vertx:run -Dvertx.runArgs="-cluster
  -Djava.net.preferIPv4Stack=true"

```<code>[INFO] Launching Vert.x Application
[INFO] Vert.x application redeploy enabled
[INFO] No plugin execution collected. The vertx:initialize goal has not been run beforehand. Only handling resources and java compilation
[INFO] Observing path:/Users/isaack/reactivejava_ws/msg_drvn_consumer/src/main
[INFO] May 24, 2019 1:42:20 PM io.vertx.core.impl.launcher.commands.Watcher
[INFO] INFO: Watched paths: [/Users/isaack/reactivejava_ws/msg_drvn_consumer/target/classes]
[INFO] May 24, 2019 1:42:20 PM io.vertx.core.impl.launcher.commands.Watcher
[INFO] INFO: Starting the vert.x application in redeploy mode
[INFO] Starting vert.x application...
[INFO] 2b5bd27b-b5f4-4a2b-a64f-7375f7296cc0-redeploy
[INFO] May 24, 2019 1:42:20 PM io.vertx.core.impl.launcher.commands.RunCommand
[INFO] INFO: Starting clustering...
[INFO] May 24, 2019 1:42:20 PM io.vertx.core.impl.launcher.commands.RunCommand
[INFO] INFO: No cluster-host specified so using address 172.16.7.108
[INFO] May 24, 2019 1:42:21 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport start
[INFO] INFO: ISPN000078: Starting JGroups channel ISPN
[INFO] May 24, 2019 1:42:21 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport buildChannel
[INFO] WARN: ISPN000304: More than one configuration file with specified name on classpath. The first one will be used:
[INFO]  [file:/Users/isaack/reactivejava_ws/msg_drvn_consumer/src/main/resources/jgroups.xml, file:/Users/isaack/reactivejava_ws/msg_drvn_consumer/target/classes/jgroups.xml, jar:file:/Users/isaack/.m2/repository/io/vertx/vertx-infinispan/3.4.0/vertx-infinispan-3.4.0.jar!/jgroups.xml]
[INFO] May 24, 2019 1:42:27 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport viewAccepted
[INFO] INFO: ISPN000094: Received new cluster view for channel ISPN: [Isaacs-MacBook-Pro-2-48763|0] (1) [Isaacs-MacBook-Pro-2-48763]
[INFO] May 24, 2019 1:42:27 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport startJGroupsChannelIfNeeded
[INFO] INFO: ISPN000079: Channel ISPN local address is Isaacs-MacBook-Pro-2-48763, physical addresses are [127.0.0.1:7800]
[INFO] May 24, 2019 1:42:27 PM org.infinispan.factories.GlobalComponentRegistry start
[INFO] INFO: ISPN000128: Infinispan version: Infinispan 'Ruppaner' 9.0.0.CR2
[INFO] May 24, 2019 1:42:27 PM org.infinispan.expiration.impl.ExpirationManagerImpl start
[INFO] INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread
[INFO] May 24, 2019 1:42:27 PM org.infinispan.expiration.impl.ExpirationManagerImpl start
[INFO] INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread
[INFO] May 24, 2019 1:42:28 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
[INFO] INFO: Succeeded in deploying verticle
</code>```

Trying to call the app on http://localhost:8082/, I still get
No handlers for address hello

I have tried this but I have already added the cluster flag and its not working. Thanks.

Below is my jgroups.xml I used in both services as a response a comment, Still any help is highly appreciated.  Its in my resources folder

```<code><?xml version="1.0" encoding="UTF-8"?>
<!--

 This jgroup configuration discovers only nodes running on the local machine using the 127.0.0.1 local address.
 It does not use multicast, but unicast.

-->
<config xmlns="urn:org:jgroups"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups-4.0.xsd">
  <TCP bind_addr="127.0.0.1"
       bind_port="7800"
  />
  <TCPPING port_range="5"/>
  <MERGE3 min_interval="10000"
          max_interval="30000"
  />
  <FD_SOCK/>
  <FD_ALL timeout="60000"
          interval="15000"
          timeout_check_interval="5000"
  />
  <VERIFY_SUSPECT timeout="5000"/>
  <pbcast.NAKACK2 use_mcast_xmit="false"
                  xmit_interval="1000"
                  xmit_table_num_rows="50"
                  xmit_table_msgs_per_row="1024"
                  xmit_table_max_compaction_time="30000"
                  resend_last_seqno="true"
  />
  <UNICAST3 xmit_interval="500"
            xmit_table_num_rows="50"
            xmit_table_msgs_per_row="1024"
            xmit_table_max_compaction_time="30000"
            conn_expiry_timeout="0"
  />
  <pbcast.STABLE stability_delay="500"
                 desired_avg_gossip="5000"
                 max_bytes="1M"
  />
  <pbcast.GMS print_local_addr="false"
              join_timeout="${jgroups.join_timeout:5000}"
  />
  <MFC max_credits="2m"
       min_threshold="0.40"
  />
  <CENTRAL_LOCK use_thread_id_for_lock_owner="false" bypass_bundling="true"/>
  <COUNTER bypass_bundling="true"/>
</config>
</code>```

答: After a chat with @tsegismont, The running the application without the jgroups.xml file does the trick. </p>

Body:
I am doing a demo on how to use the Vert.x event bus. However the messages are not sent to the consumer. All I got was

No handlers for address hello

when I invocked the service, Here is the consumer, Here is the exact example I am following, and how I am running it.

public class HelloMicroservice extends AbstractVerticle {

    @Override
    public void start() {
        vertx.eventBus().<String>consumer("hello", message -> {
            JsonObject json = new JsonObject()
                    .put("served-by", this.toString());
            if (message.body().isEmpty()) {
                message.reply(json.put("message", "hello"));
            } else {
                message.reply(json.put("message", "hello " + message.body()));
            }
        });
    }
}

I run the verticle with the cluster flag as described in the example like this,

mvn compile vertx:run -Dvertx.runArgs="-cluster -Djava.net.preferIPv4Stack=true

Below are the logs for the first verticle

[INFO] Launching Vert.x Application
[INFO] Vert.x application redeploy enabled
[INFO] No plugin execution collected. The vertx:initialize goal has not been run beforehand. Only handling resources and java compilation
[INFO] Observing path:/Users/isaack/reactivejava_ws/message_driven_ms/src/main
[INFO] May 24, 2019 1:31:42 PM io.vertx.core.impl.launcher.commands.Watcher
[INFO] INFO: Watched paths: [/Users/isaack/reactivejava_ws/message_driven_ms/target/classes]
[INFO] May 24, 2019 1:31:42 PM io.vertx.core.impl.launcher.commands.Watcher
[INFO] INFO: Starting the vert.x application in redeploy mode
[INFO] Starting vert.x application...
[INFO] bd066fa5-6786-45dc-9044-b08adbf80cb9-redeploy
[INFO] May 24, 2019 1:31:43 PM io.vertx.core.impl.launcher.commands.RunCommand
[INFO] INFO: Starting clustering...
[INFO] May 24, 2019 1:31:43 PM io.vertx.core.impl.launcher.commands.RunCommand
[INFO] INFO: No cluster-host specified so using address 172.16.7.108
[INFO] May 24, 2019 1:31:44 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport start
[INFO] INFO: ISPN000078: Starting JGroups channel ISPN
[INFO] May 24, 2019 1:31:49 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport viewAccepted
[INFO] INFO: ISPN000094: Received new cluster view for channel ISPN: [Isaacs-MacBook-Pro-2-55471|0] (1) [Isaacs-MacBook-Pro-2-55471]
[INFO] May 24, 2019 1:31:49 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport startJGroupsChannelIfNeeded
[INFO] INFO: ISPN000079: Channel ISPN local address is Isaacs-MacBook-Pro-2-55471, physical addresses are [127.0.0.1:7801]
[INFO] May 24, 2019 1:31:49 PM org.infinispan.factories.GlobalComponentRegistry start
[INFO] INFO: ISPN000128: Infinispan version: Infinispan 'Ruppaner' 9.0.0.CR2
[INFO] May 24, 2019 1:31:49 PM org.infinispan.expiration.impl.ExpirationManagerImpl start
[INFO] INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread
[INFO] May 24, 2019 1:31:49 PM org.infinispan.expiration.impl.ExpirationManagerImpl start
[INFO] INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread
[INFO] May 24, 2019 1:31:50 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
[INFO] INFO: Succeeded in deploying verticle

This is the Second Verticle that sends some messages to the consumer, Its a different project that is run separately locally.

 public class BaseMicroservice extends AbstractVerticle {

    @Override
    public void start() {
        vertx.createHttpServer()
                .requestHandler(
                        req -> {
                            Single<JsonObject> obs1 = vertx.eventBus()
                                    .<JsonObject>rxSend("hello", "Luke")
                                    .map(Message::body);
                            Single<JsonObject> obs2 = vertx.eventBus()
                                    .<JsonObject>rxSend("hello", "Leia")
                                    .map(Message::body);
                            Single.zip(obs1, obs2, (luke, leia) ->
                                            new JsonObject()
                                                    .put("Luke", luke.getString("message")
                                                            + " from " + luke.getString("served-by"))
                                                    .put("Leia", leia.getString("message")
                                                            + " from " + leia.getString("served-by"))
                                    ).subscribe(
                                            x -> req.response().end(x.encodePrettily()),
                                            t -> req.response().setStatusCode(500).end(t.getMessage())
                                    );
                        })
                .listen(8082);
    }

}

I am running with the command below.

mvn compile vertx:run -Dvertx.runArgs="-cluster
  -Djava.net.preferIPv4Stack=true"

[INFO] Launching Vert.x Application
[INFO] Vert.x application redeploy enabled
[INFO] No plugin execution collected. The vertx:initialize goal has not been run beforehand. Only handling resources and java compilation
[INFO] Observing path:/Users/isaack/reactivejava_ws/msg_drvn_consumer/src/main
[INFO] May 24, 2019 1:42:20 PM io.vertx.core.impl.launcher.commands.Watcher
[INFO] INFO: Watched paths: [/Users/isaack/reactivejava_ws/msg_drvn_consumer/target/classes]
[INFO] May 24, 2019 1:42:20 PM io.vertx.core.impl.launcher.commands.Watcher
[INFO] INFO: Starting the vert.x application in redeploy mode
[INFO] Starting vert.x application...
[INFO] 2b5bd27b-b5f4-4a2b-a64f-7375f7296cc0-redeploy
[INFO] May 24, 2019 1:42:20 PM io.vertx.core.impl.launcher.commands.RunCommand
[INFO] INFO: Starting clustering...
[INFO] May 24, 2019 1:42:20 PM io.vertx.core.impl.launcher.commands.RunCommand
[INFO] INFO: No cluster-host specified so using address 172.16.7.108
[INFO] May 24, 2019 1:42:21 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport start
[INFO] INFO: ISPN000078: Starting JGroups channel ISPN
[INFO] May 24, 2019 1:42:21 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport buildChannel
[INFO] WARN: ISPN000304: More than one configuration file with specified name on classpath. The first one will be used:
[INFO]  [file:/Users/isaack/reactivejava_ws/msg_drvn_consumer/src/main/resources/jgroups.xml, file:/Users/isaack/reactivejava_ws/msg_drvn_consumer/target/classes/jgroups.xml, jar:file:/Users/isaack/.m2/repository/io/vertx/vertx-infinispan/3.4.0/vertx-infinispan-3.4.0.jar!/jgroups.xml]
[INFO] May 24, 2019 1:42:27 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport viewAccepted
[INFO] INFO: ISPN000094: Received new cluster view for channel ISPN: [Isaacs-MacBook-Pro-2-48763|0] (1) [Isaacs-MacBook-Pro-2-48763]
[INFO] May 24, 2019 1:42:27 PM org.infinispan.remoting.transport.jgroups.JGroupsTransport startJGroupsChannelIfNeeded
[INFO] INFO: ISPN000079: Channel ISPN local address is Isaacs-MacBook-Pro-2-48763, physical addresses are [127.0.0.1:7800]
[INFO] May 24, 2019 1:42:27 PM org.infinispan.factories.GlobalComponentRegistry start
[INFO] INFO: ISPN000128: Infinispan version: Infinispan 'Ruppaner' 9.0.0.CR2
[INFO] May 24, 2019 1:42:27 PM org.infinispan.expiration.impl.ExpirationManagerImpl start
[INFO] INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread
[INFO] May 24, 2019 1:42:27 PM org.infinispan.expiration.impl.ExpirationManagerImpl start
[INFO] INFO: ISPN000025: wakeUpInterval is <= 0, not starting expired purge thread
[INFO] May 24, 2019 1:42:28 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
[INFO] INFO: Succeeded in deploying verticle

Trying to call the app on http://localhost:8082/, I still get
No handlers for address hello

I have tried this but I have already added the cluster flag and its not working. Thanks.

Below is my jgroups.xml I used in both services as a response a comment, Still any help is highly appreciated.  Its in my resources folder

<?xml version="1.0" encoding="UTF-8"?>

<config xmlns="urn:org:jgroups"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups-4.0.xsd">
  <TCP bind_addr="127.0.0.1"
       bind_port="7800"
  />
  <TCPPING port_range="5"/>
  <MERGE3 min_interval="10000"
          max_interval="30000"
  />
  <FD_SOCK/>
  <FD_ALL timeout="60000"
          interval="15000"
          timeout_check_interval="5000"
  />
  <VERIFY_SUSPECT timeout="5000"/>
  <pbcast.NAKACK2 use_mcast_xmit="false"
                  xmit_interval="1000"
                  xmit_table_num_rows="50"
                  xmit_table_msgs_per_row="1024"
                  xmit_table_max_compaction_time="30000"
                  resend_last_seqno="true"
  />
  <UNICAST3 xmit_interval="500"
            xmit_table_num_rows="50"
            xmit_table_msgs_per_row="1024"
            xmit_table_max_compaction_time="30000"
            conn_expiry_timeout="0"
  />
  <pbcast.STABLE stability_delay="500"
                 desired_avg_gossip="5000"
                 max_bytes="1M"
  />
  <pbcast.GMS print_local_addr="false"
              join_timeout="${jgroups.join_timeout:5000}"
  />
  <MFC max_credits="2m"
       min_threshold="0.40"
  />
  <CENTRAL_LOCK use_thread_id_for_lock_owner="false" bypass_bundling="true"/>
  <COUNTER bypass_bundling="true"/>
</config>


问:
\afterpage and \endfloat
How do I combine \afterpage and \endfloat to easily switch between having figures and tables at the end of the document or having them in the text?

I want to easily choose between my figures at the end of the document and my figures in the text. Because of that, sometimes I will use \afterpage package and other times I will use \endfloat would be nice to combine both.

Right now, all the times I try to run \endfloat when I have a clear page, I get the following message:

Argument of \efloat@xfloat has an extra }.

I already tried to include after page in the DeclareDelayedFloatFlavor, something like:

\DeclareDelayedFloatFlavor{afterpage}{figure}

It did not work.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}

\usepackage{float}
\usepackage{afterpage}

% ---------------------
%figures at the end
% ---------------------
\usepackage[nolists]{endfloat}
    % force landscape at the end

\begin{document}
    {\afterpage{
    \begin{figure}

    \end{figure}
    }
\end{document}
```

答:
If you want to switch between having figures within the text and at the end, I suggest to only use the endfloat package. Commenting or commenting it's optional argument disable will allow you to quickly alternate between figures at the end or in the text.

I'm not entirely certain what the purpose of afterpage was in your example, but if you used it to move the figure to a separate page, this can conveniently be done with the p floating specifier.

```<code>\documentclass{article}

\usepackage[
disable
]{endfloat}

\begin{document}

test

\begin{figure}[p]
xxx
\caption{caption}
\end{figure}

test
\end{document}
</code>```

Title: \afterpage and \endfloat

Body:
If you want to switch between having figures within the text and at the end, I suggest to only use the endfloat package. Commenting or commenting it's optional argument disable will allow you to quickly alternate between figures at the end or in the text.

I'm not entirely certain what the purpose of afterpage was in your example, but if you used it to move the figure to a separate page, this can conveniently be done with the p floating specifier.

\documentclass{article}

\usepackage[
disable
]{endfloat}

\begin{document}

test

\begin{figure}[p]
xxx
\caption{caption}
\end{figure}

test
\end{document}


问:
How to search a user by object SID in ldap
We have this design when a SID from a scanned and synced with Azure AD local LDAP v3. comes back in as a part of a JWT token. I need to find the user in the local LDAP for authorization purposes.
The SID comes in a well known serialized form supported by the Microsoft tools used for initial synchronization. Here's the LDAP environment:

```<code>"java.naming.provider.url" -> "ldap://AD2012.local:389"
 "java.naming.factory.initial" -> "com.sun.jndi.ldap.LdapCtxFactory"
 "com.sun.jndi.ldap.connect.timeout" -> "0"
 "java.naming.security.principal" -> "CN=Administrator,CN=Users,DC=AD2012,DC=local"
 "java.naming.security.authentication" -> "simple"
 "java.naming.security.credentials" -> "Password1"
 "java.naming.referral" -> "follow"
</code>```

Please note the last one as I think it is important.

In my test I first run a search to get the user using the following string:

```<code>(&(|(objectClass=User)(objectClass=userProxy))(cn=Administrator*))
</code>```

It works fine and lets me obtain the SID for this user that, after the String conversion, looks like

```<code>S-1-5-21-1061109567-1712144220-1378238271-319
</code>```

But when I construct the second search string:

```<code>(&(|(objectClass=User)(objectClass=userProxy))(objectSid=S-1-5-21-1061109567-1712144220-1378238271-319))
</code>```

the search result is empty. However, there's a clue: examining the result object with the debugger reveals that it has the following properties:

```<code>refEx.handleReferrals = 1
refEx.nextReferralEx = LdapReferralException: Continuation Reference ...
refEx.nextReferals.referrals[0] = ldap://DomainDnsZones.AD2012.local/DC=DomainDnsZones,DC=AD2012,DC=local
</code>```

Here's the question: why does the server not follow the referrals in the second - by the SID - search? I know it does in the first as the search fails if I remove the "follow" environment property.
Any input is greatly appreciated.

答:
ObjectSID is painful to work with from LDAP.

ObjectSID is a binary value that needs to be converted to be used for LDAP Search Filters:

For example, suppose your SID in string form was S-1-5-21-2562418665-3218585558-1813906818-1576. In binary form, this is:

```<code>01,05,00,00,00,00,00,05,15,00,00,00,e9,67,bb,98,d6,b7,d7,bf,82,05,1e,6c,28,06,00,00
</code>```

so the LDAP search filter would be:

```<code>(objectSid=\01\05\00\00\00\00\00\05\15\00\00\00\e9\67\bb\98\d6\b7\d7\bf\82\05\1e\6c\28\06\00\00)
</code>```

Body:
We have this design when a SID from a scanned and synced with Azure AD local LDAP v3. comes back in as a part of a JWT token. I need to find the user in the local LDAP for authorization purposes.
The SID comes in a well known serialized form supported by the Microsoft tools used for initial synchronization. Here's the LDAP environment:

"java.naming.provider.url" -> "ldap://AD2012.local:389"
 "java.naming.factory.initial" -> "com.sun.jndi.ldap.LdapCtxFactory"
 "com.sun.jndi.ldap.connect.timeout" -> "0"
 "java.naming.security.principal" -> "CN=Administrator,CN=Users,DC=AD2012,DC=local"
 "java.naming.security.authentication" -> "simple"
 "java.naming.security.credentials" -> "Password1"
 "java.naming.referral" -> "follow"

Please note the last one as I think it is important.

In my test I first run a search to get the user using the following string:

(&(|(objectClass=User)(objectClass=userProxy))(cn=Administrator*))

It works fine and lets me obtain the SID for this user that, after the String conversion, looks like

S-1-5-21-1061109567-1712144220-1378238271-319

But when I construct the second search string:

(&(|(objectClass=User)(objectClass=userProxy))(objectSid=S-1-5-21-1061109567-1712144220-1378238271-319))

the search result is empty. However, there's a clue: examining the result object with the debugger reveals that it has the following properties:

refEx.handleReferrals = 1
refEx.nextReferralEx = LdapReferralException: Continuation Reference ...
refEx.nextReferals.referrals[0] = ldap://DomainDnsZones.AD2012.local/DC=DomainDnsZones,DC=AD2012,DC=local

Here's the question: why does the server not follow the referrals in the second - by the SID - search? I know it does in the first as the search fails if I remove the "follow" environment property.
Any input is greatly appreciated.

Body:
ObjectSID is painful to work with from LDAP.

ObjectSID is a binary value that needs to be converted to be used for LDAP Search Filters:

For example, suppose your SID in string form was S-1-5-21-2562418665-3218585558-1813906818-1576. In binary form, this is:

01,05,00,00,00,00,00,05,15,00,00,00,e9,67,bb,98,d6,b7,d7,bf,82,05,1e,6c,28,06,00,00

so the LDAP search filter would be:

(objectSid=\01\05\00\00\00\00\00\05\15\00\00\00\e9\67\bb\98\d6\b7\d7\bf\82\05\1e\6c\28\06\00\00)


问:
How to truncate a list if condition is satisfied
I have a list of values and basically I want to go through the list, and check if I have more than 20 consecutive values below a certain minimum. If that is true I want to end the list where the last number above minimum was.

I tried the following with no success :

```<code>for j in range(0,len(List)):
    if all(k<minimumthreshold for k in List[j:j+20]):
        List= [e for e in List if e != j]
</code>```

答:
```<code>_list = [12,34,41,145,11,43,123,32]
counter = 0
limit = 3
thresold = 50
index = 0
split = 0
for num in _list:
    if num < thresold:
        counter = counter + 1
        print counter
        if counter == limit:
            split = index
            break
    else:
        counter = 0
    index = index + 1

print (_list[:split])
</code>```

Body:
I have a list of values and basically I want to go through the list, and check if I have more than 20 consecutive values below a certain minimum. If that is true I want to end the list where the last number above minimum was.

I tried the following with no success :

for j in range(0,len(List)):
    if all(k<minimumthreshold for k in List[j:j+20]):
        List= [e for e in List if e != j]


问:
ASP.NET Core 2.2 Web API gives 404 after hosting on IIS
I created an ASP.Net Core 2.2 Web Api Project and it is running locally without any issue. After I publish it to the file system, it is always giving me 404 issue. I have enabled windows fetures related to IIS and asp.net framework web api2 applications are running well in the same server.

I have enabled swagger doc and has used Microsoft.AspNetCore.Authentication libs too.

Program.cs

```<code>using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace US.BOX.AuthAPI
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();
        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>();
    }
}
</code>```

Startup.cs

```<code>using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using US.BOX.AuthAPI.Extensions;

namespace US.BOX.AuthAPI
{
    public class Startup
    {
        private readonly IConfiguration _configuration;
        public Startup(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {

            services.Configure<IISOptions>(options =>
            {
                options.ForwardClientCertificate = false;
            });

            services.Configure<ApiBehaviorOptions>(options =>
            {
                options.SuppressModelStateInvalidFilter = true;
            });

            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
            services.AddSingleton<IAuthenticationSchemeProvider, CustomAuthenticationSchemeProvider>();

            services.AddSwaggerDocumentation();
            services.AddJwtBearerAuthentication(_configuration);

            services.AddCors();
            services.AddLogging();

            services.AddMvc()
                .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, ILogger<Startup> logger)
        {
            app.UseAuthentication();

            if (env.IsDevelopment())
            {
                app.UseSwaggerDocumentation();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseMvc();
        }
    }
}
</code>```

appsettings.json

```<code>{
  "JWT": {
    // TODO: This should be updated for production deployment
    "SecurityKey": "sDIkdjhkalUthsaCVjsdfiskokrge",
    "Issuer": "https://{host_name}:{port}",
    "Audience": "https://{host_name}:{port}",
    "ExpirationTimeInMinutes": 60
  },
  "Logging": {
    "LogFilePath": "Logs/auth-{Date}.txt",
    "LogLevel": {
      "Default": "Warning"
    }
  },
  "AllowedHosts": "*"
}
</code>```

UsersController.cs

```<code>using System;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace US.BOX.AuthAPI.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class UsersController : ControllerBase
    {
        [HttpGet]
        public IActionResult GetAll()
        {
            try
            {
                return Ok("Users");
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
</code>```

After I published it generates following web.config file

```<code><?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\US.BOX.AuthAPI.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>
</code>```

答:
below are some of the checklist you can check if you have done it.

Install windows-hosting-bundle-installer for you dotnet core version for your OS. you can download it from the below link

Create a new application pool in you IIS for dotnet core you can check the below images for the settings

Target any application related to dotnet core to the newly created app pool, for all the hosting.

see if the above solves the issue. revert for any queries
vote and like if your issue is resolved so that it might help someone.

Body:
I created an ASP.Net Core 2.2 Web Api Project and it is running locally without any issue. After I publish it to the file system, it is always giving me 404 issue. I have enabled windows fetures related to IIS and asp.net framework web api2 applications are running well in the same server.

I have enabled swagger doc and has used Microsoft.AspNetCore.Authentication libs too.

Program.cs

using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace US.BOX.AuthAPI
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();
        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>();
    }
}

Startup.cs

using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using US.BOX.AuthAPI.Extensions;

namespace US.BOX.AuthAPI
{
    public class Startup
    {
        private readonly IConfiguration _configuration;
        public Startup(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {

            services.Configure<IISOptions>(options =>
            {
                options.ForwardClientCertificate = false;
            });

            services.Configure<ApiBehaviorOptions>(options =>
            {
                options.SuppressModelStateInvalidFilter = true;
            });

            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
            services.AddSingleton<IAuthenticationSchemeProvider, CustomAuthenticationSchemeProvider>();

            services.AddSwaggerDocumentation();
            services.AddJwtBearerAuthentication(_configuration);

            services.AddCors();
            services.AddLogging();

            services.AddMvc()
                .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, ILogger<Startup> logger)
        {
            app.UseAuthentication();

            if (env.IsDevelopment())
            {
                app.UseSwaggerDocumentation();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseMvc();
        }
    }
}

appsettings.json

{
  "JWT": {
    // TODO: This should be updated for production deployment
    "SecurityKey": "sDIkdjhkalUthsaCVjsdfiskokrge",
    "Issuer": "https://{host_name}:{port}",
    "Audience": "https://{host_name}:{port}",
    "ExpirationTimeInMinutes": 60
  },
  "Logging": {
    "LogFilePath": "Logs/auth-{Date}.txt",
    "LogLevel": {
      "Default": "Warning"
    }
  },
  "AllowedHosts": "*"
}

UsersController.cs

using System;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace US.BOX.AuthAPI.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class UsersController : ControllerBase
    {
        [HttpGet]
        public IActionResult GetAll()
        {
            try
            {
                return Ok("Users");
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}

After I published it generates following web.config file

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\US.BOX.AuthAPI.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>


问:
Angular 7 how to execute script tag from dynamic HTML
I'm integrating GrapesJS with Lory slider into angular 7, and I need to load inline scripts that the editor generates to give functionality to the slider.

I need to load dynamically components inside the HTML that's why I use "dynamic-html" component.

I've tried to reload the scripts with directives but nothing works, it seems that Angular can't find the element.

TS

```<code>@Component({
  selector: 'app-paginas',
  styleUrls: ['./paginas.component.scss'],
  encapsulation: ViewEncapsulation.ShadowDom,
  template : `<dynamic-html [content]="pagina.html"></dynamic-html>`
})
</code>```

Script that editor returns inside "pagina.html"

```<code><script>var items = document.querySelectorAll('#ixuhz');        for (var i = 0, len = items.length; i < len; i++) {          (function(){var e=this,t="https://cdnjs.cloudflare.com/ajax/libs/lory.js/2.3.4/lory.min.js",l=["0","false"],s="";s="true"==s?1:parseInt(s,10);var a={slidesToScroll:parseInt("1",10),enableMouseEvents:l.indexOf("")>=0?0:1,infinite:!isNaN(s)&&s,rewind:!(l.indexOf("")>=0),slideSpeed:parseInt("300",10),rewindSpeed:parseInt("600",10),snapBackSpeed:parseInt("200",10),ease:"ease",classNameFrame:"gjs-lory-frame",classNameSlideContainer:"gjs-lory-slides",classNamePrevCtrl:"gjs-lory-prev",classNameNextCtrl:"gjs-lory-next"},r=function(){window.sliderLory=lory(e,a)};if("undefined"==typeof lory){var n=document.createElement("script");n.src=t,n.onload=r,document.head.appendChild(n)}else r()}.bind(items[i]))();        }</script>
</code>```

Expecting get some result but not find anything

Trying to get the element with Jquery or JS

```<code>ngAfterViewInit(){
  console.log($("#ixuhz"));
}
</code>```

答:
you can use import {DomSanitizer} from '@angular/platform-browser' to sanitaze dynamic data added into template.

But i think need to use it like this

Here is link to document

Body:
I'm integrating GrapesJS with Lory slider into angular 7, and I need to load inline scripts that the editor generates to give functionality to the slider.

I need to load dynamically components inside the HTML that's why I use "dynamic-html" component.

I've tried to reload the scripts with directives but nothing works, it seems that Angular can't find the element.

TS

@Component({
  selector: 'app-paginas',
  styleUrls: ['./paginas.component.scss'],
  encapsulation: ViewEncapsulation.ShadowDom,
  template : `<dynamic-html [content]="pagina.html"></dynamic-html>`
})

Script that editor returns inside "pagina.html"

Expecting get some result but not find anything

Trying to get the element with Jquery or JS

ngAfterViewInit(){
  console.log($("#ixuhz"));
}

Body:
you can use import {DomSanitizer} from '@angular/platform-browser' to sanitaze dynamic data added into template.

But i think need to use it like this
<div [innerHTML]="sanitizer.bypassSecurityTrustHtml(content)"></div>

Here is link to document