Hi singhshikha,
We do rely on some system calls such as closesocket, htons etc. Please confirm you are linking in your standard library. If so, you will need to provide wolfSSL with your OS' equivalent to these functions. We check if our function aliases such as CloseSocket have been defined, which allows you to override them by defining them in your user_settings.h:
#define CloseSocket(s) YourCloseSocketFn(s)
#define XHTONS(a) YourHtoNsFn((a))
#define XINET_PTON(a,b,c) YourInet_PtonFn((a),(b),(c))
#define DTLS_RECVFROM_FUNCTION YourRecvFromFn
#define DTLS_SENDTO_FUNCTION YourSendToFn
If you don't have any of these functions, you'll need to define a wrapper function instead which provides equivalent functionality.
setsockopt, getpeername and getsockopt are currently called directly in our code and can't be overridden.
WSAGetLastError is coming from USE_WINDOWS_API, don't define this if you don't have Windows API support.
If you continue to run into issues, please reach out to us at support AT wolfssl DOT com with your user_settings.h. It would also be helpful to know what kind of system calls your OS has available.
I recommend upgrading to our latest release 5.6.0 when feasible for the best support and performance.
Thanks,
Kareem